NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
COSGConnectionPool Class Reference

Search Toolkit Book for COSGConnectionPool

#include "osg_connection.hpp"
(Private to src/app/pubseq_gateway/server.)

+ Inheritance diagram for COSGConnectionPool:
+ Collaboration diagram for COSGConnectionPool:

Public Types

typedef int TEnabledFlags
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 COSGConnectionPool ()
 
virtual ~COSGConnectionPool ()
 
void AppParseArgs (const CArgs &args)
 
void LoadConfig (const CNcbiRegistry &registry, string section=string())
 
void SetLogging (EDiagSev severity)
 
size_t GetMaxConnectionCount () const
 
size_t GetRetryCount () const
 
TEnabledFlags GetDefaultEnabledFlags () const
 
double GetCDDRetryTimeout () const
 
CRef< COSGConnectionAllocateConnection ()
 
void ReleaseConnection (CRef< COSGConnection > &conn)
 
bool GetAsyncProcessing () const
 
bool GetWaitBeforeOSG () const
 
void Queue (CRef< CThreadPool_Task > task)
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Protected Member Functions

void RemoveConnection (COSGConnection &conn)
 
void x_OpenConnection (COSGConnection &conn)
 
TSvrRef x_GetServer ()
 
void x_AcceptFeedback (TSvrRef server, int feedback)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Private Attributes

string m_ServiceName
 
int m_MaxConnectionCount
 
double m_ExpirationTimeout
 
double m_ReadTimeout
 
double m_CDDRetryTimeout
 
int m_RetryCount
 
TEnabledFlags m_DefaultEnabledFlags
 
bool m_WaitBeforeOSG
 
bool m_AsyncProcessing
 
CMutex m_Mutex
 
CSemaphore m_WaitConnectionSlot
 
size_t m_NextConnectionID
 
int m_ConnectionCount
 
int m_ConnectFailureCount
 
list< CRef< COSGConnection > > m_FreeConnections
 
CRef< COSGServiceMapperm_Mapper
 
CRef< CPoolBalancerm_Balancer
 
unique_ptr< CDeadlinem_NonresolutionRetryDeadline
 
unique_ptr< CThreadPoolm_ThreadPool
 

Friends

class COSGConnection
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Detailed Description

Definition at line 117 of file osg_connection.hpp.

Member Typedef Documentation

◆ TEnabledFlags

Definition at line 134 of file osg_connection.hpp.

Constructor & Destructor Documentation

◆ COSGConnectionPool()

COSGConnectionPool::COSGConnectionPool ( )

Definition at line 300 of file osg_connection.cpp.

◆ ~COSGConnectionPool()

COSGConnectionPool::~COSGConnectionPool ( )
virtual

Definition at line 318 of file osg_connection.cpp.

Member Function Documentation

◆ AllocateConnection()

CRef< COSGConnection > COSGConnectionPool::AllocateConnection ( )

◆ AppParseArgs()

void COSGConnectionPool::AppParseArgs ( const CArgs args)

Definition at line 323 of file osg_connection.cpp.

◆ GetAsyncProcessing()

bool COSGConnectionPool::GetAsyncProcessing ( ) const
inline

◆ GetCDDRetryTimeout()

double COSGConnectionPool::GetCDDRetryTimeout ( ) const
inline

◆ GetDefaultEnabledFlags()

TEnabledFlags COSGConnectionPool::GetDefaultEnabledFlags ( ) const
inline

Definition at line 135 of file osg_connection.hpp.

References m_DefaultEnabledFlags.

Referenced by LoadConfig().

◆ GetMaxConnectionCount()

size_t COSGConnectionPool::GetMaxConnectionCount ( ) const
inline

Definition at line 127 of file osg_connection.hpp.

References m_MaxConnectionCount.

Referenced by CPSGS_OSGProcessorBase::DoProcess().

◆ GetRetryCount()

size_t COSGConnectionPool::GetRetryCount ( void  ) const
inline

Definition at line 130 of file osg_connection.hpp.

References m_RetryCount.

Referenced by CPSGS_OSGProcessorBase::DoProcess().

◆ GetWaitBeforeOSG()

bool COSGConnectionPool::GetWaitBeforeOSG ( ) const
inline

Definition at line 150 of file osg_connection.hpp.

References m_WaitBeforeOSG.

Referenced by CPSGS_OSGProcessorBase::DoProcess().

◆ LoadConfig()

void COSGConnectionPool::LoadConfig ( const CNcbiRegistry registry,
string  section = string() 
)

Definition at line 341 of file osg_connection.cpp.

References AllocateConnection(), CHECK_PARAM_MIN, conn, eDebug_open, eDebugLevel_default, ERR_POST, CPSGS_OSGProcessorBase::fEnabledCDD, CPSGS_OSGProcessorBase::fEnabledSNP, CPSGS_OSGProcessorBase::fEnabledWGS, g_OSG_GetPreferredAddress(), IRegistry::GetBool(), GetDebugLevel(), GetDefaultEnabledFlags(), GetDiagSeverity(), IRegistry::GetDouble(), IRegistry::GetInt(), IRegistry::GetString(), CSeq_id::IdentifyAccession(), COSGServiceMapper::InitDefaults(), kConfigSection, kDefaultAsyncProcessing, kDefaultCDDRetryTimeout, kDefaultEnabledCDD, kDefaultEnabledSNP, kDefaultEnabledWGS, kDefaultExpirationTimeout, kDefaultMaxConnectionCount, kDefaultPreference, kDefaultPreferredServer, kDefaultReadTimeout, kDefaultRetryCount, kDefaultServiceName, kDefaultWaitBeforeOSG, kMax_UInt, kMinCDDRetryTimeout, kMinExpirationTimeout, kMinMaxConnectionCount, kMinRetryCount, kParamAsyncProcessing, kParamCDDRetryTimeout, kParamDebugLevel, kParamEnabledCDD, kParamEnabledSNP, kParamEnabledWGS, kParamExpirationTimeout, kParamMaxConnectionCount, kParamPreference, kParamPreferredServer, kParamReadTimeout, kParamRetryCount, kParamServiceName, kParamWaitBeforeOSG, LOG_POST, m_AsyncProcessing, m_CDDRetryTimeout, m_DefaultEnabledFlags, m_ExpirationTimeout, m_Mapper, m_MaxConnectionCount, m_ReadTimeout, m_RetryCount, m_ServiceName, m_ThreadPool, m_WaitBeforeOSG, CSocketAPI::ntoa(), registry, ReleaseConnection(), SetDebugLevel(), CDBLB_ServiceMapper::SetPreference(), and Warning().

◆ Queue()

void COSGConnectionPool::Queue ( CRef< CThreadPool_Task task)

Definition at line 468 of file osg_connection.cpp.

References m_ThreadPool.

Referenced by CPSGS_OSGProcessorBase::CallDoProcessAsync().

◆ ReleaseConnection()

void COSGConnectionPool::ReleaseConnection ( CRef< COSGConnection > &  conn)

◆ RemoveConnection()

void COSGConnectionPool::RemoveConnection ( COSGConnection conn)
protected

◆ SetLogging()

void COSGConnectionPool::SetLogging ( EDiagSev  severity)

Definition at line 462 of file osg_connection.cpp.

References SetDiagSeverity().

◆ x_AcceptFeedback()

void COSGConnectionPool::x_AcceptFeedback ( TSvrRef  server,
int  feedback 
)
protected

◆ x_GetServer()

TSvrRef COSGConnectionPool::x_GetServer ( )
protected

◆ x_OpenConnection()

void COSGConnectionPool::x_OpenConnection ( COSGConnection conn)
protected

Friends And Related Function Documentation

◆ COSGConnection

friend class COSGConnection
friend

Definition at line 157 of file osg_connection.hpp.

Referenced by AllocateConnection().

Member Data Documentation

◆ m_AsyncProcessing

bool COSGConnectionPool::m_AsyncProcessing
private

Definition at line 174 of file osg_connection.hpp.

Referenced by GetAsyncProcessing(), and LoadConfig().

◆ m_Balancer

CRef<CPoolBalancer> COSGConnectionPool::m_Balancer
private

Definition at line 182 of file osg_connection.hpp.

Referenced by x_AcceptFeedback(), and x_GetServer().

◆ m_CDDRetryTimeout

double COSGConnectionPool::m_CDDRetryTimeout
private

Definition at line 170 of file osg_connection.hpp.

Referenced by GetCDDRetryTimeout(), and LoadConfig().

◆ m_ConnectFailureCount

int COSGConnectionPool::m_ConnectFailureCount
private

Definition at line 179 of file osg_connection.hpp.

Referenced by AllocateConnection(), and x_OpenConnection().

◆ m_ConnectionCount

int COSGConnectionPool::m_ConnectionCount
private

Definition at line 178 of file osg_connection.hpp.

Referenced by AllocateConnection(), ReleaseConnection(), and RemoveConnection().

◆ m_DefaultEnabledFlags

TEnabledFlags COSGConnectionPool::m_DefaultEnabledFlags
private

Definition at line 172 of file osg_connection.hpp.

Referenced by GetDefaultEnabledFlags(), and LoadConfig().

◆ m_ExpirationTimeout

double COSGConnectionPool::m_ExpirationTimeout
private

Definition at line 168 of file osg_connection.hpp.

Referenced by AllocateConnection(), and LoadConfig().

◆ m_FreeConnections

list<CRef<COSGConnection> > COSGConnectionPool::m_FreeConnections
private

Definition at line 180 of file osg_connection.hpp.

Referenced by AllocateConnection(), and ReleaseConnection().

◆ m_Mapper

CRef<COSGServiceMapper> COSGConnectionPool::m_Mapper
private

Definition at line 181 of file osg_connection.hpp.

Referenced by LoadConfig(), x_AcceptFeedback(), and x_GetServer().

◆ m_MaxConnectionCount

int COSGConnectionPool::m_MaxConnectionCount
private

Definition at line 167 of file osg_connection.hpp.

Referenced by AllocateConnection(), GetMaxConnectionCount(), and LoadConfig().

◆ m_Mutex

CMutex COSGConnectionPool::m_Mutex
private

◆ m_NextConnectionID

size_t COSGConnectionPool::m_NextConnectionID
private

Definition at line 177 of file osg_connection.hpp.

Referenced by AllocateConnection().

◆ m_NonresolutionRetryDeadline

unique_ptr<CDeadline> COSGConnectionPool::m_NonresolutionRetryDeadline
private

Definition at line 183 of file osg_connection.hpp.

Referenced by x_GetServer().

◆ m_ReadTimeout

double COSGConnectionPool::m_ReadTimeout
private

Definition at line 169 of file osg_connection.hpp.

Referenced by LoadConfig(), and x_OpenConnection().

◆ m_RetryCount

int COSGConnectionPool::m_RetryCount
private

Definition at line 171 of file osg_connection.hpp.

Referenced by GetRetryCount(), and LoadConfig().

◆ m_ServiceName

string COSGConnectionPool::m_ServiceName
private

Definition at line 166 of file osg_connection.hpp.

Referenced by LoadConfig(), x_AcceptFeedback(), x_GetServer(), and x_OpenConnection().

◆ m_ThreadPool

unique_ptr<CThreadPool> COSGConnectionPool::m_ThreadPool
private

Definition at line 184 of file osg_connection.hpp.

Referenced by LoadConfig(), and Queue().

◆ m_WaitBeforeOSG

bool COSGConnectionPool::m_WaitBeforeOSG
private

Definition at line 173 of file osg_connection.hpp.

Referenced by GetWaitBeforeOSG(), and LoadConfig().

◆ m_WaitConnectionSlot

CSemaphore COSGConnectionPool::m_WaitConnectionSlot
private

Definition at line 176 of file osg_connection.hpp.

Referenced by AllocateConnection(), ReleaseConnection(), and RemoveConnection().


The documentation for this class was generated from the following files:
Modified on Sun Apr 21 03:42:00 2024 by modify_doxy.py rev. 669887