#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...
virtual void * toCbdata ()=0

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) 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 Abort (void *param)
 called by Store if the entry is no longer usable More...

Protected Attributes

Comm::ConnectionPointer clientConnection
 HTTP client descriptor. More...
 store entry with the cache manager response More...
 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...
const InstanceId< AsyncJobid
 job identifier 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 28 of file StoreToCommWriter.h.

Member Typedef Documentation

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file StoreToCommWriter.cc.

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

Member Function Documentation

void Mgr::StoreToCommWriter::Abort ( void *  param)

Definition at line 161 of file StoreToCommWriter.cc.

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

Referenced by start().

void AsyncJob::callEnd ( )
void AsyncJob::callStart ( AsyncCall call)
bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file AsyncJob.cc.

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

Mgr::StoreToCommWriter::CBDATA_CLASS ( StoreToCommWriter  )
void Mgr::StoreToCommWriter::close ( )

closes our copy of the client HTTP connection socket

Definition at line 43 of file StoreToCommWriter.cc.

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

void AsyncJob::deleteThis ( const char *  aReason)
bool AsyncJob::done ( ) const

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

bool Mgr::StoreToCommWriter::doneAll ( ) const

Reimplemented from AsyncJob.

Definition at line 153 of file StoreToCommWriter.cc.

References STORE_OK.

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

Definition at line 129 of file StoreToCommWriter.cc.

References debugs, HERE(), Comm::IsConnOpen(), and Must.

Referenced by StoreToCommWriter().

void Mgr::StoreToCommWriter::noteCommWrote ( const CommIoCbParams params)
void Mgr::StoreToCommWriter::noteStoreCopied ( StoreIOBuffer  ioBuf)
void Mgr::StoreToCommWriter::NoteStoreCopied ( void *  data,
StoreIOBuffer  ioBuf 

Definition at line 79 of file StoreToCommWriter.cc.

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

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

Definition at line 69 of file StoreToCommWriter.cc.

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

void Mgr::StoreToCommWriter::start ( )

Reimplemented from AsyncJob.

Reimplemented in Mgr::ActionWriter, and Mgr::Filler.

Definition at line 55 of file StoreToCommWriter.cc.

References Abort(), debugs, HERE(), Comm::IsConnOpen(), Must, NULL, sc, and storeClientListAdd().

Referenced by Mgr::ActionWriter::start(), and Mgr::Filler::start().

void Mgr::StoreToCommWriter::swanSong ( )

Reimplemented from AsyncJob.

Reimplemented in Mgr::Filler.

Definition at line 137 of file StoreToCommWriter.cc.

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

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

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

char Mgr::StoreToCommWriter::buffer[HTTP_REQBUF_SZ]

Definition at line 68 of file StoreToCommWriter.h.

Comm::ConnectionPointer Mgr::StoreToCommWriter::clientConnection

Definition at line 61 of file StoreToCommWriter.h.

Referenced by Abort(), and StoreToCommWriter().

AsyncCall::Pointer Mgr::StoreToCommWriter::closer

Definition at line 67 of file StoreToCommWriter.h.

Referenced by StoreToCommWriter().

StoreEntry* Mgr::StoreToCommWriter::entry

Definition at line 63 of file StoreToCommWriter.h.

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 72 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
store_client* Mgr::StoreToCommWriter::sc

Definition at line 64 of file StoreToCommWriter.h.

const char* AsyncJob::stopReason
int64_t Mgr::StoreToCommWriter::writeOffset

Definition at line 65 of file StoreToCommWriter.h.

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






Web Site Translations