represents a single "stateful helper" process More...

#include <helper.h>

Inheritance diagram for helper_stateful_server:
Collaboration diagram for helper_stateful_server:

Public Types

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

Public Member Functions

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

Static Public Member Functions

static void HelperServerClosed (helper_stateful_server *srv)
 close handler to handle exited server processes More...
 

Public Attributes

statefulhelperparent
 
Helper::ReservationId reservationId
 "confirmation ID" of the last More...
 
time_t reservationStart
 when the last reservation was made More...
 
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

 CBDATA_CHILD (helper_stateful_server)
 

Detailed Description

Definition at line 293 of file helper.h.

Member Typedef Documentation

◆ Requests

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

Definition at line 225 of file helper.h.

Constructor & Destructor Documentation

◆ ~helper_stateful_server()

helper_stateful_server::~helper_stateful_server ( )
virtual

Member Function Documentation

◆ CBDATA_CHILD()

helper_stateful_server::CBDATA_CHILD ( helper_stateful_server  )
private

◆ clearReservation()

void helper_stateful_server::clearReservation ( )

◆ closePipesSafely()

void HelperServerBase::closePipesSafely ( const char *  name)
inherited

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 73 of file helper.cc.

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

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

◆ closeWritePipeSafely()

void HelperServerBase::closeWritePipeSafely ( const char *  name)
inherited

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 99 of file helper.cc.

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

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

◆ dropQueued()

◆ getParent()

virtual helper* helper_stateful_server::getParent ( ) const
inlineoverridevirtual

Implements HelperServerBase.

Definition at line 304 of file helper.h.

Referenced by HelperServerClosed().

◆ HelperServerClosed()

void helper_stateful_server::HelperServerClosed ( helper_stateful_server srv)
static

◆ initStats()

void HelperServerBase::initStats ( )
inherited

Definition at line 63 of file helper.cc.

References HelperServerBase::stats.

Referenced by helperOpenServers(), and helperStatefulOpenServers().

◆ reserve()

void helper_stateful_server::reserve ( )

◆ reserved()

virtual bool helper_stateful_server::reserved ( )
inlineoverridevirtual

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ addr

Ip::Address HelperServerBase::addr
inherited

Definition at line 205 of file helper.h.

Referenced by helperOpenServers(), and helperStatefulOpenServers().

◆ answer_time

struct timeval HelperServerBase::answer_time
inherited

Definition at line 215 of file helper.h.

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

◆ dispatch_time

struct timeval HelperServerBase::dispatch_time
inherited

◆ flags

◆ hIpc

void* HelperServerBase::hIpc
inherited

◆ index

◆ link

◆ parent

statefulhelper* helper_stateful_server::parent

◆ pending

◆ pid

◆ rbuf

char* HelperServerBase::rbuf
inherited

◆ rbuf_sz

◆ readPipe

◆ releases

uint64_t HelperServerBase::releases
inherited

Definition at line 232 of file helper.h.

◆ replies

uint64_t HelperServerBase::replies
inherited

◆ requests

◆ reservationId

Helper::ReservationId helper_stateful_server::reservationId

◆ reservationStart

time_t helper_stateful_server::reservationStart

Definition at line 316 of file helper.h.

Referenced by helperStatefulOpenServers(), and StatefulGetFirstAvailable().

◆ roffset

size_t HelperServerBase::roffset
inherited

◆ stats

◆ timedout

uint64_t HelperServerBase::timedout
inherited

Definition at line 233 of file helper.h.

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

◆ uses

uint64_t HelperServerBase::uses
inherited

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