#include <Inquirer.h>

Inheritance diagram for Mgr::Inquirer:
Collaboration diagram for Mgr::Inquirer:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 Inquirer (Action::Pointer anAction, const Request &aCause, const Ipc::StrandCoords &coords)
 
void callException (const std::exception &e) override
 called when the job throws during an async call 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...
 
void handleStopRequest ()
 process external request to terminate now (i.e. during this async call) More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void HandleRemoteAck (const Response &response)
 finds and calls the right Inquirer upon strand's response More...
 
static void Start (const Pointer &job)
 
static void RegisterWithCacheManager ()
 

Public Attributes

CodeContextPointer codeContext
 
const InstanceId< AsyncJobid
 job identifier More...
 

Protected Member Functions

void start () override
 called by AsyncStart; do not call directly More...
 
bool doneAll () const override
 whether positive goal has been reached More...
 
void cleanup () override
 closes our copy of the client HTTP connection socket More...
 
void sendResponse () override
 send response to client More...
 
bool aggregate (Ipc::Response::Pointer aResponse) override
 perform aggregating of responses and returns true if need to continue More...
 
void swanSong () override
 
const char * status () const override
 internal cleanup; do not call directly More...
 
virtual void inquire ()
 inquire the next strand More...
 
virtual void handleException (const std::exception &e)
 do specific exception handling More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 

Static Protected Member Functions

static void ReportAllJobs (StoreEntry *)
 writes a cache manager report about all jobs existing in this worker More...
 

Protected Attributes

Request::Pointer request
 cache manager request received from client More...
 
Ipc::StrandCoords strands
 all strands we want to query, in order More...
 
Ipc::StrandCoords::const_iterator pos
 strand we should query now More...
 
const double timeout
 number of seconds to wait for strand response More...
 
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...
 
bool started_ = false
 Start() has finished successfully. More...
 
bool swanSang_ = false
 swanSong() was called More...
 

Static Protected Attributes

static RequestId::Index LastRequestId = 0
 last requestId used More...
 

Private Member Functions

 CBDATA_CHILD (Inquirer)
 
void noteWroteHeader (const CommIoCbParams &params)
 called when we wrote the response header More...
 
void noteCommClosed (const CommCloseCbParams &params)
 called when the HTTP client or some external force closed our socket More...
 
void removeCloseHandler ()
 
Ipc::StrandCoords applyQueryParams (const Ipc::StrandCoords &aStrands, const QueryParams &aParams)
 
 CBDATA_INTERMEDIATE ()
 
void handleRemoteAck (Response::Pointer response)
 called when a strand is done writing its output More...
 
void requestTimedOut ()
 called when the strand failed to respond (or finish responding) in time More...
 
void removeTimeoutEvent ()
 called when we are no longer waiting for the strand to respond More...
 
virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...
 

Static Private Member Functions

static void RequestTimedOut (void *param)
 Ipc::Inquirer::requestTimedOut wrapper. More...
 

Private Attributes

Action::Pointer aggrAction
 
Comm::ConnectionPointer conn
 HTTP client socket descriptor. More...
 
AsyncCall::Pointer writer
 comm_write callback More...
 
AsyncCall::Pointer closer
 comm_close handler More...
 

Detailed Description

Coordinator's job that sends a cache manage request to each strand, aggregating individual strand responses and dumping the result if needed

Definition at line 26 of file Inquirer.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ Inquirer()

Mgr::Inquirer::Inquirer ( Action::Pointer  anAction,
const Request aCause,
const Ipc::StrandCoords coords 
)

Member Function Documentation

◆ aggregate()

bool Mgr::Inquirer::aggregate ( Ipc::Response::Pointer  aResponse)
overrideprotectedvirtual

Implements Ipc::Inquirer.

Definition at line 128 of file Inquirer.cc.

References Mgr::Response::getAction(), and Mgr::Response::hasAction().

◆ applyQueryParams()

Ipc::StrandCoords Mgr::Inquirer::applyQueryParams ( const Ipc::StrandCoords aStrands,
const QueryParams aParams 
)
private

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

void Ipc::Inquirer::callException ( const std::exception &  e)
overridevirtualinherited

Reimplemented from AsyncJob.

Definition at line 159 of file Inquirer.cc.

References AsyncJob::callException(), DBG_CRITICAL, debugs, and MYNAME.

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 117 of file AsyncJob.cc.

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

◆ CBDATA_CHILD()

Mgr::Inquirer::CBDATA_CHILD ( Inquirer  )
private

◆ CBDATA_INTERMEDIATE()

Ipc::Inquirer::CBDATA_INTERMEDIATE ( )
privateinherited

◆ cleanup()

void Mgr::Inquirer::cleanup ( )
overrideprotectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 52 of file Inquirer.cc.

References conn, and Comm::IsConnOpen().

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

bool Mgr::Inquirer::doneAll ( ) const
overrideprotectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 147 of file Inquirer.cc.

References Ipc::Inquirer::doneAll().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ handleException()

void Ipc::Inquirer::handleException ( const std::exception &  e)
protectedvirtualinherited

Reimplemented in Snmp::Inquirer.

Definition at line 152 of file Inquirer.cc.

References debugs.

Referenced by Snmp::Inquirer::handleException().

◆ HandleRemoteAck()

void Ipc::Inquirer::HandleRemoteAck ( const Response response)
staticinherited

◆ handleRemoteAck()

void Ipc::Inquirer::handleRemoteAck ( Response::Pointer  response)
privateinherited

Definition at line 118 of file Inquirer.cc.

References debugs, and Must.

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 73 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ inquire()

void Ipc::Inquirer::inquire ( )
protectedvirtualinherited

◆ mustStop()

◆ noteCommClosed()

void Mgr::Inquirer::noteCommClosed ( const CommCloseCbParams params)
private

Definition at line 116 of file Inquirer.cc.

References conn, debugs, and MYNAME.

Referenced by Inquirer().

◆ noteWroteHeader()

void Mgr::Inquirer::noteWroteHeader ( const CommIoCbParams params)
private

◆ RegisterWithCacheManager()

void AsyncJob::RegisterWithCacheManager ( )
staticinherited

Definition at line 215 of file AsyncJob.cc.

References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().

Referenced by mainInitialize().

◆ removeCloseHandler()

void Mgr::Inquirer::removeCloseHandler ( )
private

Definition at line 61 of file Inquirer.cc.

References comm_remove_close_handler(), and conn.

◆ removeTimeoutEvent()

void Ipc::Inquirer::removeTimeoutEvent ( )
privateinherited

Definition at line 186 of file Inquirer.cc.

References eventDelete(), eventFind(), and Ipc::Inquirer::RequestTimedOut().

◆ ReportAllJobs()

void AsyncJob::ReportAllJobs ( StoreEntry e)
staticprotectedinherited

Definition at line 198 of file AsyncJob.cc.

References AllJobs().

Referenced by AsyncJob::RegisterWithCacheManager().

◆ requestTimedOut()

void Ipc::Inquirer::requestTimedOut ( )
privateinherited

Definition at line 207 of file Inquirer.cc.

References debugs, Ipc::DequeueRequest(), Must, and MYNAME.

◆ RequestTimedOut()

void Ipc::Inquirer::RequestTimedOut ( void *  param)
staticprivateinherited

◆ sendResponse()

void Mgr::Inquirer::sendResponse ( )
overrideprotectedvirtual

Implements Ipc::Inquirer.

Definition at line 137 of file Inquirer.cc.

References conn, and AsyncJob::Start().

◆ start()

◆ Start()

◆ status()

const char * Ipc::Inquirer::status ( ) const
overrideprotectedvirtualinherited

for debugging, starts with space

Reimplemented from AsyncJob.

Definition at line 220 of file Inquirer.cc.

References Packable::appendf(), MemBuf::content(), MemBuf::reset(), and MemBuf::terminate().

◆ swanSong()

void Ipc::Inquirer::swanSong ( )
overrideprotectedvirtualinherited

Reimplemented from AsyncJob.

Definition at line 133 of file Inquirer.cc.

References debugs, Ipc::DequeueRequest(), and MYNAME.

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ aggrAction

Action::Pointer Mgr::Inquirer::aggrAction
private

Definition at line 51 of file Inquirer.h.

Referenced by Inquirer().

◆ closer

AsyncCall::Pointer Mgr::Inquirer::closer
private

Definition at line 56 of file Inquirer.h.

Referenced by Inquirer().

◆ codeContext

CodeContextPointer Ipc::Inquirer::codeContext
inherited

Definition at line 41 of file Inquirer.h.

Referenced by Ipc::Inquirer::RequestTimedOut().

◆ conn

Comm::ConnectionPointer Mgr::Inquirer::conn
private

Definition at line 53 of file Inquirer.h.

Referenced by Inquirer().

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 75 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ LastRequestId

Ipc::RequestId::Index Ipc::Inquirer::LastRequestId = 0
staticprotectedinherited

Definition at line 76 of file Inquirer.h.

◆ pos

Ipc::StrandCoords::const_iterator Ipc::Inquirer::pos
protectedinherited

Definition at line 72 of file Inquirer.h.

◆ request

Request::Pointer Ipc::Inquirer::request
protectedinherited

Definition at line 69 of file Inquirer.h.

Referenced by Snmp::Inquirer::Inquirer().

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 88 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ strands

Ipc::StrandCoords Ipc::Inquirer::strands
protectedinherited

Definition at line 71 of file Inquirer.h.

Referenced by Ipc::Inquirer::Inquirer().

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 89 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().

◆ timeout

const double Ipc::Inquirer::timeout
protectedinherited

Definition at line 74 of file Inquirer.h.

◆ typeName

◆ writer

AsyncCall::Pointer Mgr::Inquirer::writer
private

Definition at line 55 of file Inquirer.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors