Coordinates shared activities of Strands (Squid processes or threads) More...

#include <Coordinator.h>

Inheritance diagram for Ipc::Coordinator:
Collaboration diagram for Ipc::Coordinator:

Public Types

typedef CbcPointer< AsyncJobPointer

Public Member Functions

 Coordinator ()
void broadcastSignal (int sig) const
 send sig to registered strands More...
const StrandCoordsstrands () const
 currently registered strands More...
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
void callStart (AsyncCall &call)
virtual void callEnd ()
 called right after the called job method More...
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
virtual void * toCbdata ()=0

Static Public Member Functions

static CoordinatorInstance ()
static String MakeAddr (const char *proccessLabel, int id)
 calculates IPC message address for strand id of processLabel type More...
static String CoordinatorAddr ()
 get the IPC message address for coordinator process More...
static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...

Public Attributes

struct sockaddr_un address
 UDS address from path; treat as read-only. More...

Protected Member Functions

virtual void start ()
 called by AsyncStart; do not call directly More...
virtual void receive (const TypedMsgHdr &message)
 handle IPC message just
StrandCoordfindStrand (int kidId)
 registered strand or NULL More...
void registerStrand (const StrandCoord &)
 adds or updates existing More...
void handleRegistrationRequest (const HereIamMessage &)
 register,ACK More...
void notifySearcher (const StrandSearchRequest &request, const StrandCoord &)
 answer the waiting search request More...
void handleSearchRequest (const StrandSearchRequest &request)
 answers or queues the request if the answer is not yet known More...
void handleSharedListenRequest (const SharedListenRequest &request)
 returns cached socket or calls openListenSocket() More...
void handleCacheMgrRequest (const Mgr::Request &request)
void handleCacheMgrResponse (const Mgr::Response &response)
void handleSnmpRequest (const Snmp::Request &request)
void handleSnmpResponse (const Snmp::Response &response)
Comm::ConnectionPointer openListenSocket (const SharedListenRequest &request, int &errNo)
 calls comm_open_listener() More...
virtual bool doneAll () const
 whether positive goal has been reached More...
void doListen ()
 read the next incoming message More...
virtual void timedout ()
 called after setTimeout() if timed out More...
Comm::ConnectionPointerconn ()
 creates if needed and returns raw UDS socket descriptor More...
void setTimeout (int seconds, const char *handlerName)
 call timedout() if no UDS messages in a given number of seconds More...
void clearTimeout ()
 remove previously set timeout, if any More...
void setOptions (int newOptions)
 changes socket options More...
void deleteThis (const char *aReason)
void mustStop (const char *aReason)
bool done () const
 the job is destroyed in callEnd() when done() More...
virtual void swanSong ()
virtual const char * status () const
 internal cleanup; do not call directly More...

Protected Attributes

const char * stopReason
 reason for forcing done() to be true More...
const char * typeName
 kid (leaf) class name, for debugging More...
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
const InstanceId< AsyncJobid
 job identifier More...

Private Types

typedef std::list< StrandSearchRequestSearchers
 search requests More...
typedef std::map< OpenListenerParams, Comm::ConnectionPointerListeners
 params:connection map More...

Private Member Functions

 CBDATA_CLASS (Coordinator)
 Coordinator (const Coordinator &)
Coordinatoroperator= (const Coordinator &)

Private Attributes

StrandCoords strands_
 registered processes and threads More...
Searchers searchers
 yet unanswered search requests in arrival order More...
Listeners listeners
 cached comm_open_listener() results More...

Static Private Attributes

static CoordinatorTheInstance = NULL
 the only class instance in existence More...

Detailed Description

Definition at line 30 of file Coordinator.h.

Member Typedef Documentation

◆ Listeners

Definition at line 74 of file Coordinator.h.

◆ Pointer

Definition at line 34 of file AsyncJob.h.

◆ Searchers

Definition at line 71 of file Coordinator.h.

Constructor & Destructor Documentation

◆ Coordinator() [1/2]

Ipc::Coordinator::Coordinator ( )

Definition at line 34 of file

Referenced by Instance().

◆ Coordinator() [2/2]

Ipc::Coordinator::Coordinator ( const Coordinator )

Member Function Documentation

◆ broadcastSignal()

void Ipc::Coordinator::broadcastSignal ( int  sig) const

Definition at line 281 of file

References debugs, HERE(), and strands_.

◆ callEnd()

void AsyncJob::callEnd ( )

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Referenced by AsyncJob::swanSong().


Ipc::Coordinator::CBDATA_CLASS ( Coordinator  )

◆ clearTimeout()

void Ipc::UdsOp::clearTimeout ( )

◆ conn()

◆ CoordinatorAddr()

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)

◆ doListen()

◆ done()

◆ doneAll()

bool Ipc::Port::doneAll ( ) const

Reimplemented from AsyncJob.

Definition at line 46 of file

◆ findStrand()

Ipc::StrandCoord * Ipc::Coordinator::findStrand ( int  kidId)

Definition at line 44 of file

References NULL, and strands_.

Referenced by registerStrand().

◆ handleCacheMgrRequest()

◆ handleCacheMgrResponse()

void Ipc::Coordinator::handleCacheMgrResponse ( const Mgr::Response response)

Definition at line 193 of file

References Ipc::Inquirer::HandleRemoteAck().

Referenced by receive().

◆ handleRegistrationRequest()

void Ipc::Coordinator::handleRegistrationRequest ( const HereIamMessage msg)

◆ handleSearchRequest()

void Ipc::Coordinator::handleSearchRequest ( const StrandSearchRequest request)

◆ handleSharedListenRequest()

◆ handleSnmpRequest()

void Ipc::Coordinator::handleSnmpRequest ( const Snmp::Request request)

◆ handleSnmpResponse()

void Ipc::Coordinator::handleSnmpResponse ( const Snmp::Response response)

Definition at line 246 of file

References debugs, Ipc::Inquirer::HandleRemoteAck(), and HERE().

Referenced by receive().

◆ Instance()

Ipc::Coordinator * Ipc::Coordinator::Instance ( )

Definition at line 291 of file

References Coordinator(), and TheInstance.

Referenced by SquidMain().

◆ MakeAddr()

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)

Definition at line 69 of file

References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.

Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Http::Tunneler::handleConnectionClosure(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), Adaptation::Ecap::XactionRep::noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().

◆ notifySearcher()

◆ openListenSocket()

◆ operator=()

Coordinator& Ipc::Coordinator::operator= ( const Coordinator )

◆ receive()

◆ registerStrand()

void Ipc::Coordinator::registerStrand ( const StrandCoord strand)

◆ setOptions()

void Ipc::UdsOp::setOptions ( int  newOptions)

Definition at line 35 of file

References Ipc::UdsOp::options.

Referenced by Ipc::Port::Port(), and Ipc::UdsOp::timedout().

◆ setTimeout()

void Ipc::UdsOp::setTimeout ( int  seconds,
const char *  handlerName 

◆ Start()

◆ start()

void Ipc::Coordinator::start ( )

Implements Ipc::Port.

Definition at line 39 of file

References Ipc::Port::start().

◆ status()

◆ strands()

const Ipc::StrandCoords & Ipc::Coordinator::strands ( ) const

Definition at line 302 of file

References strands_.

◆ swanSong()

◆ timedout()

virtual void Ipc::UdsOp::timedout ( )

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ address

struct sockaddr_un Ipc::UdsOp::address

Definition at line 36 of file UdsOp.h.

Referenced by Ipc::UdsOp::conn(), and Ipc::UdsSender::UdsSender().

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ listeners

Listeners Ipc::Coordinator::listeners

Definition at line 75 of file Coordinator.h.

Referenced by handleSharedListenRequest(), and openListenSocket().

◆ searchers

Searchers Ipc::Coordinator::searchers

Definition at line 72 of file Coordinator.h.

Referenced by handleSearchRequest(), and registerStrand().

◆ stopReason

const char* AsyncJob::stopReason

◆ strands_

StrandCoords Ipc::Coordinator::strands_

◆ TheInstance

Ipc::Coordinator * Ipc::Coordinator::TheInstance = NULL

Definition at line 77 of file Coordinator.h.

Referenced by Instance().

◆ typeName

The documentation for this class was generated from the following files:






Web Site Translations