HelperServerBase Class Referenceabstract

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 (const char *desc, Ip::Address &, int aPid, void *aIpc, int rfd, int wfd)
 
virtual ~HelperServerBase ()
 
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...
 
virtual void * toCbdata ()=0
 

Public Attributes

const InstanceId< HelperServerBaseindex
 
int pid = 0
 
Ip::Address addr
 
Comm::ConnectionPointer readPipe
 
Comm::ConnectionPointer writePipe
 
void * hIpc = nullptr
 
char * rbuf = nullptr
 
size_t rbuf_sz = 0
 
size_t roffset = 0
 
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 = 0
 requests sent to this helper More...
 
   uint64_t   replies = 0
 replies received from this helper More...
 
   uint64_t   pending = 0
 queued lookups waiting to be sent to this helper More...
 
   uint64_t   releases = 0
 times release() has been called on this helper (if stateful) More...
 
   uint64_t   timedout = 0
 requests which timed-out More...
 
stats
 

Detailed Description

Definition at line 160 of file helper.h.

Member Typedef Documentation

◆ Requests

Definition at line 216 of file helper.h.

Constructor & Destructor Documentation

◆ HelperServerBase()

HelperServerBase::HelperServerBase ( const char *  desc,
Ip::Address ip,
int  aPid,
void *  aIpc,
int  rfd,
int  wfd 
)

◆ ~HelperServerBase()

HelperServerBase::~HelperServerBase ( )
virtual

Definition at line 146 of file helper.cc.

References memFreeBuf(), NULL, 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 63 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 89 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 helperStatefulServerDone(), helper_server::~helper_server(), and helper_stateful_server::~helper_stateful_server().

◆ dropQueued()

◆ getParent()

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

Implemented in helper_stateful_server, and helper_server.

◆ reserved()

virtual bool HelperServerBase::reserved ( )
pure virtual

Implemented in helper_stateful_server, and helper_server.

Referenced by helper::packStatsInto().

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ addr

Ip::Address HelperServerBase::addr

Definition at line 196 of file helper.h.

◆ answer_time

struct timeval HelperServerBase::answer_time

Definition at line 206 of file helper.h.

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

◆ dispatch_time

struct timeval HelperServerBase::dispatch_time

◆ flags

◆ hIpc

void* HelperServerBase::hIpc = nullptr

Definition at line 199 of file helper.h.

Referenced by closePipesSafely(), and closeWritePipeSafely().

◆ index

◆ link

dlink_node HelperServerBase::link

◆ pending

◆ pid

int HelperServerBase::pid = 0

Definition at line 195 of file helper.h.

Referenced by closePipesSafely(), closeWritePipeSafely(), and helper::packStatsInto().

◆ rbuf

char* HelperServerBase::rbuf = nullptr

Definition at line 201 of file helper.h.

Referenced by helperHandleRead(), helperStatefulHandleRead(), and ~HelperServerBase().

◆ rbuf_sz

size_t HelperServerBase::rbuf_sz = 0

◆ readPipe

◆ releases

uint64_t HelperServerBase::releases = 0

Definition at line 223 of file helper.h.

◆ replies

uint64_t HelperServerBase::replies = 0

◆ requests

◆ roffset

size_t HelperServerBase::roffset = 0

Definition at line 203 of file helper.h.

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

◆ stats

◆ timedout

uint64_t HelperServerBase::timedout = 0

Definition at line 224 of file helper.h.

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

◆ uses

uint64_t HelperServerBase::uses = 0

Definition at line 220 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