NCBI C++ ToolKit
Classes | Macros | Functions | Variables
osg_connection.cpp File Reference
#include <ncbi_pch.hpp>
#include "osg_connection.hpp"
#include <corelib/ncbithr.hpp>
#include <connect/ncbi_conn_stream.hpp>
#include <objects/id2/ID2_Request.hpp>
#include <objects/id2/ID2_Param.hpp>
#include <objects/id2/ID2_Params.hpp>
#include <objects/id2/ID2_Request_Packet.hpp>
#include <objects/id2/ID2_Reply.hpp>
#include <objects/id2/ID2_Reply_Data.hpp>
#include <serial/serial.hpp>
#include <serial/iterator.hpp>
#include <util/thread_pool.hpp>
#include <cmath>
#include <corelib/ncbi_system.hpp>
#include <corelib/impl/ncbi_dbsvcmapper.hpp>
#include "osg_processor_base.hpp"
#include "osg_mapper.hpp"
#include "pubseq_gateway_logging.hpp"
+ Include dependency graph for osg_connection.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SConditionalASNLogger< Type >
 

Macros

#define CHECK_PARAM_MIN(value, name, min_value)
 

Functions

 BEGIN_NAMESPACE (psg)
 
 BEGIN_NAMESPACE (osg)
 
template<class Type >
CNcbiOstreamoperator<< (CNcbiOstream &out, const SConditionalASNLogger< Type > &logger)
 
template<class Type >
SConditionalASNLogger< TypeLogASNIf (const Type &obj, bool condition)
 
static DECLARE_TLS_VAR (int, s_NoFailureCount)
 
static void s_SimulateFailure (const char *where)
 
static Uint4 g_OSG_GetPreferredAddress (const string &name)
 
 END_NAMESPACE (osg)
 
 END_NAMESPACE (psg)
 

Variables

 BEGIN_NCBI_NAMESPACE
 
static const char kConfigSection [] = "OSG_PROCESSOR"
 
static const char kParamServiceName [] = "service"
 
static const char kParamMaxConnectionCount [] = "maxconn"
 
static const char kParamDebugLevel [] = "debug"
 
static const char kParamExpirationTimeout [] = "expiration_timeout"
 
static const char kParamReadTimeout [] = "read_timeout"
 
static const char kParamCDDRetryTimeout [] = "cdd_retry_timeout"
 
static const char kParamRetryCount [] = "retry_count"
 
static const char kParamPreferredServer [] = "preferred_server"
 
static const char kParamPreference [] = "preference"
 
static const char kParamEnabledCDD [] = "enabled_cdd"
 
static const char kParamEnabledSNP [] = "enabled_snp"
 
static const char kParamEnabledWGS [] = "enabled_wgs"
 
static const char kParamAsyncProcessing [] = "async_processing"
 
static const char kParamWaitBeforeOSG [] = "wait_before_osg"
 
static const char kDefaultServiceName [] = "ID2_SNP2"
 
static const int kMinMaxConnectionCount = 1
 
static const int kDefaultMaxConnectionCount = 64
 
static const EDebugLevel kDefaultDebugLevel = eDebug_error
 
static const double kMinExpirationTimeout = 1
 
static const double kDefaultExpirationTimeout = 60
 
static const double kDefaultReadTimeout = 30
 
static const double kMinCDDRetryTimeout = .1
 
static const double kDefaultCDDRetryTimeout = 0.9
 
static const int kMinRetryCount = 1
 
static const int kDefaultRetryCount = 3
 
static const char kDefaultPreferredServer [] = "localhost"
 
static const int kDefaultPreference = 90
 
static const bool kDefaultEnabledCDD = false
 
static const bool kDefaultEnabledSNP = true
 
static const bool kDefaultEnabledWGS = true
 
static const COSGConnectionPool::TEnabledFlags kDefaultEnabledFlags
 
static const bool kDefaultAsyncProcessing = true
 
static const bool kDefaultWaitBeforeOSG = true
 
static const int kNonResolutionTimeout = 5
 
const bool kSimulateFailures = false
 
const int kNoFailureCount = 8
 
const int kFailureRate = 8
 
 END_NCBI_NAMESPACE
 

Macro Definition Documentation

◆ CHECK_PARAM_MIN

#define CHECK_PARAM_MIN (   value,
  name,
  min_value 
)
Value:
do { \
if ( value < min_value ) { \
NCBI_THROW_FMT(CPubseqGatewayException, eConfigurationError, \
name<<"(="<<value<<") < "<<min_value); \
} \
} while (0)
char value[7]
Definition: config.c:431
#define min_value(a, b)
Definition: ncbi_c_log.c:140

Function Documentation

◆ BEGIN_NAMESPACE() [1/2]

BEGIN_NAMESPACE ( osg  )

◆ BEGIN_NAMESPACE() [2/2]

BEGIN_NAMESPACE ( psg  )

◆ DECLARE_TLS_VAR()

static DECLARE_TLS_VAR ( int  ,
s_NoFailureCount   
)
static

◆ END_NAMESPACE() [1/2]

END_NAMESPACE ( osg  )

◆ END_NAMESPACE() [2/2]

END_NAMESPACE ( psg  )

◆ g_OSG_GetPreferredAddress()

static Uint4 g_OSG_GetPreferredAddress ( const string name)
static

◆ LogASNIf()

template<class Type >
SConditionalASNLogger<Type> LogASNIf ( const Type obj,
bool  condition 
)

◆ operator<<()

template<class Type >
CNcbiOstream& operator<< ( CNcbiOstream out,
const SConditionalASNLogger< Type > &  logger 
)

◆ s_SimulateFailure()

static void s_SimulateFailure ( const char *  where)
static

Variable Documentation

◆ BEGIN_NCBI_NAMESPACE

BEGIN_NCBI_NAMESPACE

Definition at line 56 of file osg_connection.cpp.

◆ END_NCBI_NAMESPACE

END_NCBI_NAMESPACE

Definition at line 671 of file osg_connection.cpp.

◆ kConfigSection

const char kConfigSection[] = "OSG_PROCESSOR"
static

Definition at line 62 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultAsyncProcessing

const bool kDefaultAsyncProcessing = true
static

Definition at line 100 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultCDDRetryTimeout

const double kDefaultCDDRetryTimeout = 0.9
static

Definition at line 88 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultDebugLevel

const EDebugLevel kDefaultDebugLevel = eDebug_error
static

Definition at line 82 of file osg_connection.cpp.

◆ kDefaultEnabledCDD

const bool kDefaultEnabledCDD = false
static

Definition at line 93 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultEnabledFlags

const COSGConnectionPool::TEnabledFlags kDefaultEnabledFlags
static

◆ kDefaultEnabledSNP

const bool kDefaultEnabledSNP = true
static

Definition at line 94 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultEnabledWGS

const bool kDefaultEnabledWGS = true
static

Definition at line 95 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultExpirationTimeout

const double kDefaultExpirationTimeout = 60
static

Definition at line 84 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultMaxConnectionCount

const int kDefaultMaxConnectionCount = 64
static

Definition at line 81 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultPreference

const int kDefaultPreference = 90
static

Definition at line 92 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultPreferredServer

const char kDefaultPreferredServer[] = "localhost"
static

Definition at line 91 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultReadTimeout

const double kDefaultReadTimeout = 30
static

Definition at line 86 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultRetryCount

const int kDefaultRetryCount = 3
static

Definition at line 90 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultServiceName

const char kDefaultServiceName[] = "ID2_SNP2"
static

Definition at line 79 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kDefaultWaitBeforeOSG

const bool kDefaultWaitBeforeOSG = true
static

Definition at line 101 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kFailureRate

const int kFailureRate = 8

Definition at line 181 of file osg_connection.cpp.

Referenced by s_SimulateFailure().

◆ kMinCDDRetryTimeout

const double kMinCDDRetryTimeout = .1
static

Definition at line 87 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kMinExpirationTimeout

const double kMinExpirationTimeout = 1
static

Definition at line 83 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kMinMaxConnectionCount

const int kMinMaxConnectionCount = 1
static

Definition at line 80 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kMinRetryCount

const int kMinRetryCount = 1
static

Definition at line 89 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kNoFailureCount

const int kNoFailureCount = 8

Definition at line 180 of file osg_connection.cpp.

Referenced by s_SimulateFailure().

◆ kNonResolutionTimeout

const int kNonResolutionTimeout = 5
static

Definition at line 104 of file osg_connection.cpp.

Referenced by COSGConnectionPool::x_GetServer().

◆ kParamAsyncProcessing

const char kParamAsyncProcessing[] = "async_processing"
static

Definition at line 75 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamCDDRetryTimeout

const char kParamCDDRetryTimeout[] = "cdd_retry_timeout"
static

Definition at line 68 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamDebugLevel

const char kParamDebugLevel[] = "debug"
static

Definition at line 65 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamEnabledCDD

const char kParamEnabledCDD[] = "enabled_cdd"
static

Definition at line 72 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamEnabledSNP

const char kParamEnabledSNP[] = "enabled_snp"
static

Definition at line 73 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamEnabledWGS

const char kParamEnabledWGS[] = "enabled_wgs"
static

Definition at line 74 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamExpirationTimeout

const char kParamExpirationTimeout[] = "expiration_timeout"
static

Definition at line 66 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamMaxConnectionCount

const char kParamMaxConnectionCount[] = "maxconn"
static

Definition at line 64 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamPreference

const char kParamPreference[] = "preference"
static

Definition at line 71 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamPreferredServer

const char kParamPreferredServer[] = "preferred_server"
static

Definition at line 70 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamReadTimeout

const char kParamReadTimeout[] = "read_timeout"
static

Definition at line 67 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamRetryCount

const char kParamRetryCount[] = "retry_count"
static

Definition at line 69 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamServiceName

const char kParamServiceName[] = "service"
static

Definition at line 63 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kParamWaitBeforeOSG

const char kParamWaitBeforeOSG[] = "wait_before_osg"
static

Definition at line 76 of file osg_connection.cpp.

Referenced by COSGConnectionPool::LoadConfig().

◆ kSimulateFailures

const bool kSimulateFailures = false

Definition at line 179 of file osg_connection.cpp.

Referenced by s_SimulateFailure().

Modified on Mon Feb 26 03:59:33 2024 by modify_doxy.py rev. 669887