#include <StoreToCommWriter.h>

Inheritance diagram for Mgr::StoreToCommWriter:
Collaboration diagram for Mgr::StoreToCommWriter:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 StoreToCommWriter (const Comm::ConnectionPointer &conn, StoreEntry *anEntry)
 
virtual ~StoreToCommWriter ()
 
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...
 
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 Start (const Pointer &job)
 

Public Attributes

const InstanceId< AsyncJobid
 job identifier More...
 

Protected Member Functions

virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual void swanSong ()
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
void scheduleStoreCopy ()
 request more action results from the store More...
 
void noteStoreCopied (StoreIOBuffer ioBuf)
 receive some action results from the store More...
 
void scheduleCommWrite (const StoreIOBuffer &ioBuf)
 tell Comm to write action results More...
 
void noteCommWrote (const CommIoCbParams &params)
 called by Comm after the action results are written More...
 
void noteCommClosed (const CommCloseCbParams &params)
 called by Comm if the client socket got closed More...
 
void close ()
 closes the local connection to the HTTP client, if any More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 

Static Protected Member Functions

static void NoteStoreCopied (void *data, StoreIOBuffer ioBuf)
 
static void HandleStoreAbort (StoreToCommWriter *param)
 called by Store if the entry is no longer usable More...
 

Protected Attributes

Comm::ConnectionPointer clientConnection
 HTTP client descriptor. More...
 
StoreEntryentry
 store entry with the cache manager response More...
 
store_clientsc
 our registration with the store More...
 
int64_t writeOffset
 number of bytes written to the client More...
 
AsyncCall::Pointer closer
 comm_close handler More...
 
char buffer [HTTP_REQBUF_SZ]
 action results; Store fills, Comm writes 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...
 

Private Member Functions

 CBDATA_CLASS (StoreToCommWriter)
 

Detailed Description

manages receive-from-store, write-to-comm, receive-... sequence for the given StoreEntry and client FD

Definition at line 29 of file StoreToCommWriter.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ StoreToCommWriter()

Mgr::StoreToCommWriter::StoreToCommWriter ( const Comm::ConnectionPointer conn,
StoreEntry anEntry 
)

◆ ~StoreToCommWriter()

Mgr::StoreToCommWriter::~StoreToCommWriter ( )
virtual

Definition at line 34 of file StoreToCommWriter.cc.

References assert, debugs, HERE(), and sc.

Member Function Documentation

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 102 of file AsyncJob.cc.

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

◆ CBDATA_CLASS()

Mgr::StoreToCommWriter::CBDATA_CLASS ( StoreToCommWriter  )
private

◆ close()

void Mgr::StoreToCommWriter::close ( )
protected

closes our copy of the client HTTP connection socket

Definition at line 44 of file StoreToCommWriter.cc.

References comm_remove_close_handler(), Comm::IsConnOpen(), and NULL.

◆ deleteThis()

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

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

bool Mgr::StoreToCommWriter::doneAll ( ) const
protectedvirtual

Reimplemented from AsyncJob.

Definition at line 159 of file StoreToCommWriter.cc.

References STORE_OK.

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 71 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ HandleStoreAbort()

void Mgr::StoreToCommWriter::HandleStoreAbort ( StoreToCommWriter param)
staticprotected

Definition at line 167 of file StoreToCommWriter.cc.

References clientConnection, Comm::Connection::close(), and Comm::IsConnOpen().

Referenced by start().

◆ mustStop()

◆ noteCommClosed()

void Mgr::StoreToCommWriter::noteCommClosed ( const CommCloseCbParams params)
protected

Definition at line 131 of file StoreToCommWriter.cc.

References debugs, and HERE().

Referenced by StoreToCommWriter().

◆ noteCommWrote()

void Mgr::StoreToCommWriter::noteCommWrote ( const CommIoCbParams params)
protected

◆ noteStoreCopied()

void Mgr::StoreToCommWriter::noteStoreCopied ( StoreIOBuffer  ioBuf)
protected

◆ NoteStoreCopied()

void Mgr::StoreToCommWriter::NoteStoreCopied ( void *  data,
StoreIOBuffer  ioBuf 
)
staticprotected

Definition at line 81 of file StoreToCommWriter.cc.

References asyncCall(), Must, noteStoreCopied(), NULL, and ScheduleCallHere.

◆ scheduleCommWrite()

void Mgr::StoreToCommWriter::scheduleCommWrite ( const StoreIOBuffer ioBuf)
protected

◆ scheduleStoreCopy()

void Mgr::StoreToCommWriter::scheduleStoreCopy ( )
protected

Definition at line 71 of file StoreToCommWriter.cc.

References debugs, HERE(), Must, NULL, sc, and storeClientCopy().

◆ start()

void Mgr::StoreToCommWriter::start ( )
protectedvirtual

◆ Start()

◆ status()

◆ swanSong()

void Mgr::StoreToCommWriter::swanSong ( )
protectedvirtual

Reimplemented from AsyncJob.

Reimplemented in Mgr::Filler.

Definition at line 143 of file StoreToCommWriter.cc.

References debugs, HERE(), NULL, sc, and storeUnregister().

Referenced by Mgr::Filler::swanSong().

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ buffer

char Mgr::StoreToCommWriter::buffer[HTTP_REQBUF_SZ]
protected

Definition at line 69 of file StoreToCommWriter.h.

◆ clientConnection

Comm::ConnectionPointer Mgr::StoreToCommWriter::clientConnection
protected

Definition at line 62 of file StoreToCommWriter.h.

Referenced by StoreToCommWriter(), and HandleStoreAbort().

◆ closer

AsyncCall::Pointer Mgr::StoreToCommWriter::closer
protected

Definition at line 68 of file StoreToCommWriter.h.

Referenced by StoreToCommWriter().

◆ entry

StoreEntry* Mgr::StoreToCommWriter::entry
protected

Definition at line 64 of file StoreToCommWriter.h.

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 73 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ sc

store_client* Mgr::StoreToCommWriter::sc
protected

Definition at line 65 of file StoreToCommWriter.h.

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 83 of file AsyncJob.h.

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

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 84 of file AsyncJob.h.

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

◆ typeName

◆ writeOffset

int64_t Mgr::StoreToCommWriter::writeOffset
protected

Definition at line 66 of file StoreToCommWriter.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors