represents a single helper process abstraction More...

#include <helper.h>

Inheritance diagram for HelperServerBase:
Collaboration diagram for HelperServerBase:

Classes

struct  _helper_flags
 

Public Types

typedef std::list< Helper::Xaction * > Requests
 

Public Member Functions

 ~HelperServerBase () override
 
void closePipesSafely (const char *name)
 
void closeWritePipeSafely (const char *name)
 
virtual bool reserved ()=0
 whether the server is locked for exclusive use by a client More...
 
virtual void dropQueued ()
 dequeues and sends a Helper::Unknown answer to all queued requests More...
 
virtual helpergetParent () const =0
 the helper object that created this server More...
 
void initStats ()
 
virtual void * toCbdata ()=0
 

Public Attributes

const InstanceId< HelperServerBaseindex
 
int pid
 
Ip::Address addr
 
Comm::ConnectionPointer readPipe
 
Comm::ConnectionPointer writePipe
 
void * hIpc
 
char * rbuf
 
size_t rbuf_sz
 
size_t roffset
 
struct timeval dispatch_time
 
struct timeval answer_time
 
dlink_node link
 
struct HelperServerBase::_helper_flags flags
 
Requests requests
 requests in order of submission/expiration More...
 
struct {
   uint64_t   uses
 
   uint64_t   replies
 
   uint64_t   pending
 
   uint64_t   releases
 
   uint64_t   timedout
 
stats
 

Private Member Functions

virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...
 

Detailed Description

Definition at line 172 of file helper.h.

Member Typedef Documentation

◆ Requests

Definition at line 226 of file helper.h.

Constructor & Destructor Documentation

◆ ~HelperServerBase()

HelperServerBase::~HelperServerBase ( )
override

Definition at line 144 of file helper.cc.

References memFreeBuf(), rbuf, and rbuf_sz.

Member Function Documentation

◆ closePipesSafely()

void HelperServerBase::closePipesSafely ( const char *  name)

Closes pipes to the helper safely. Handles the case where the read and write pipes are the same FD.

Parameters
namedisplayed for the helper being shutdown if logging an error

Definition at line 74 of file helper.cc.

References Comm::Connection::close(), HelperServerBase::_helper_flags::closing, DBG_IMPORTANT, debugs, Comm::Connection::fd, flags, getCurrentTime(), hIpc, index, pid, readPipe, and writePipe.

Referenced by helperHandleRead(), helperReturnBuffer(), helperShutdown(), helperStatefulHandleRead(), and helperStatefulShutdown().

◆ closeWritePipeSafely()

void HelperServerBase::closeWritePipeSafely ( const char *  name)

Closes the reading pipe. If the read and write sockets are the same the write pipe will also be closed. Otherwise its left open for later handling.

Parameters
namedisplayed for the helper being shutdown if logging an error

Definition at line 102 of file helper.cc.

References Comm::Connection::close(), HelperServerBase::_helper_flags::closing, DBG_IMPORTANT, debugs, Comm::Connection::fd, flags, getCurrentTime(), hIpc, index, pid, readPipe, and writePipe.

Referenced by helper_server::~helper_server(), helper_stateful_server::~helper_stateful_server(), helperReturnBuffer(), and helperStatefulServerDone().

◆ dropQueued()

void HelperServerBase::dropQueued ( )
virtual

Reimplemented in helper_server.

Definition at line 128 of file helper.cc.

References requests.

Referenced by helper_server::dropQueued(), and helper_stateful_server::HelperServerClosed().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ getParent()

virtual helper * HelperServerBase::getParent ( ) const
pure virtual

Implemented in helper_server, and helper_stateful_server.

◆ initStats()

void HelperServerBase::initStats ( )

Definition at line 64 of file helper.cc.

References stats.

Referenced by helperOpenServers(), and helperStatefulOpenServers().

◆ reserved()

virtual bool HelperServerBase::reserved ( )
pure virtual

Implemented in helper_server, and helper_stateful_server.

Referenced by helper::packStatsInto().

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ addr

Ip::Address HelperServerBase::addr

Definition at line 206 of file helper.h.

Referenced by helperOpenServers(), and helperStatefulOpenServers().

◆ answer_time

struct timeval HelperServerBase::answer_time

Definition at line 216 of file helper.h.

Referenced by helperReturnBuffer(), helperStatefulHandleRead(), and helper::packStatsInto().

◆ dispatch_time

struct timeval HelperServerBase::dispatch_time

◆ flags

◆ hIpc

void* HelperServerBase::hIpc

◆ index

◆ link

◆ pending

◆ pid

int HelperServerBase::pid

◆ rbuf

char* HelperServerBase::rbuf

◆ rbuf_sz

◆ readPipe

◆ releases

uint64_t HelperServerBase::releases

Definition at line 233 of file helper.h.

◆ replies

uint64_t HelperServerBase::replies

◆ requests

◆ roffset

◆ 

◆ timedout

uint64_t HelperServerBase::timedout

Definition at line 234 of file helper.h.

Referenced by helperHandleRead(), and helper::packStatsInto().

◆ uses

uint64_t HelperServerBase::uses

Definition at line 230 of file helper.h.

Referenced by helperDispatch(), helperStatefulDispatch(), and helper::packStatsInto().

◆ writePipe


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors