NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions
misc.hpp File Reference
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <deque>
#include <thread>
#include <corelib/ncbitime.hpp>
#include <corelib/ncbi_param.hpp>
#include <connect/impl/connect_misc.hpp>
+ Include dependency graph for misc.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SThreadSafe< void >
 
struct  SPSG_CV< TType >
 
struct  CPSG_WaitingQueue< TValue >
 
struct  SPSG_ParamValue< TParam >
 

Macros

#define PSG_PARAM_VALUE_TYPE(section, name)   SPSG_ParamValue<NCBI_PARAM_TYPE(section, name)>
 
#define PSG_PARAM_VALUE_DEF_ADJUST(type, section, name, default_value)
 
#define PSG_PARAM_VALUE_DEF_MIN(type, section, name, default_value, min_value)
 

Typedefs

using TPSG_MaxConcurrentSubmits = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, max_concurrent_submits)>
 
using TPSG_MaxConcurrentRequestsPerServer = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, max_concurrent_requests_per_server)>
 
using TPSG_IoTimerPeriod = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, io_timer_period)>
 
using TPSG_RequestsPerIo = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, requests_per_io)>
 
using TPSG_RequestRetries = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, request_retries)>
 
using TPSG_RefusedStreamRetries = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, refused_stream_retries)>
 
using TPSG_UserRequestIds = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, user_request_ids)>
 
using TPSG_Service = NCBI_PARAM_TYPE(PSG, service)
 
using TPSG_AuthTokenName = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, auth_token_name)>
 
using TPSG_AuthToken = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, auth_token)>
 
using TPSG_AdminAuthTokenName = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, admin_auth_token_name)>
 
using TPSG_AdminAuthToken = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, admin_auth_token)>
 
using TPSG_ThrottlePeriod = NCBI_PARAM_TYPE(PSG, throttle_relaxation_period)
 
using TPSG_ThrottleMaxFailures = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, throttle_by_consecutive_connection_failures)>
 
using TPSG_ThrottleUntilDiscovery = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, throttle_hold_until_active_in_lb)>
 
using TPSG_ThrottleThreshold = NCBI_PARAM_TYPE(PSG, throttle_by_connection_error_rate)
 
using TPSG_DebugPrintout = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, debug_printout)>
 
using TPSG_UseCache = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, use_cache)>
 
using TPSG_PsgClientMode = SPSG_ParamValue< NCBI_PARAM_TYPE(PSG, internal_psg_client_mode)>
 

Enumerations

enum class  EPSG_DebugPrintout { eNone , eSome , eAll }
 
enum class  EPSG_UseCache { eDefault , eNo , eYes }
 
enum class  EPSG_PsgClientMode { eOff , ePerformance }
 

Functions

 NCBI_PARAM_DECL (unsigned, PSG, rd_buf_size)
 
typedef NCBI_PARAM_TYPE (PSG, rd_buf_size) TPSG_RdBufSize
 
 NCBI_PARAM_DECL (size_t, PSG, wr_buf_size)
 
typedef NCBI_PARAM_TYPE (PSG, wr_buf_size) TPSG_WrBufSize
 
 NCBI_PARAM_DECL (unsigned, PSG, max_concurrent_streams)
 
typedef NCBI_PARAM_TYPE (PSG, max_concurrent_streams) TPSG_MaxConcurrentStreams
 
 NCBI_PARAM_DECL (unsigned, PSG, max_concurrent_submits)
 
 NCBI_PARAM_DECL (unsigned, PSG, max_sessions)
 
typedef NCBI_PARAM_TYPE (PSG, max_sessions) TPSG_MaxSessions
 
 NCBI_PARAM_DECL (unsigned, PSG, max_concurrent_requests_per_server)
 
 NCBI_PARAM_DECL (unsigned, PSG, num_io)
 
typedef NCBI_PARAM_TYPE (PSG, num_io) TPSG_NumIo
 
 NCBI_PARAM_DECL (unsigned, PSG, reader_timeout)
 
typedef NCBI_PARAM_TYPE (PSG, reader_timeout) TPSG_ReaderTimeout
 
 NCBI_PARAM_DECL (double, PSG, rebalance_time)
 
typedef NCBI_PARAM_TYPE (PSG, rebalance_time) TPSG_RebalanceTime
 
 NCBI_PARAM_DECL (double, PSG, io_timer_period)
 
 NCBI_PARAM_DECL (double, PSG, request_timeout)
 
typedef NCBI_PARAM_TYPE (PSG, request_timeout) TPSG_RequestTimeout
 
 NCBI_PARAM_DECL (double, PSG, competitive_after)
 
typedef NCBI_PARAM_TYPE (PSG, competitive_after) TPSG_CompetitiveAfter
 
 NCBI_PARAM_DECL (size_t, PSG, requests_per_io)
 
 NCBI_PARAM_DECL (unsigned, PSG, request_retries)
 
 NCBI_PARAM_DECL (unsigned, PSG, refused_stream_retries)
 
 NCBI_PARAM_DECL (string, PSG, request_user_args)
 
typedef NCBI_PARAM_TYPE (PSG, request_user_args) TPSG_RequestUserArgs
 
 NCBI_PARAM_DECL (bool, PSG, user_request_ids)
 
 NCBI_PARAM_DECL (unsigned, PSG, localhost_preference)
 
typedef NCBI_PARAM_TYPE (PSG, localhost_preference) TPSG_LocalhostPreference
 
 NCBI_PARAM_DECL (bool, PSG, fail_on_unknown_items)
 
typedef NCBI_PARAM_TYPE (PSG, fail_on_unknown_items) TPSG_FailOnUnknownItems
 
 NCBI_PARAM_DECL (bool, PSG, fail_on_unknown_chunks)
 
typedef NCBI_PARAM_TYPE (PSG, fail_on_unknown_chunks) TPSG_FailOnUnknownChunks
 
 NCBI_PARAM_DECL (bool, PSG, https)
 
typedef NCBI_PARAM_TYPE (PSG, https) TPSG_Https
 
 NCBI_PARAM_DECL (double, PSG, no_servers_retry_delay)
 
typedef NCBI_PARAM_TYPE (PSG, no_servers_retry_delay) TPSG_NoServersRetryDelay
 
 NCBI_PARAM_DECL (string, PSG, service)
 
 NCBI_PARAM_DECL (string, PSG, auth_token_name)
 
 NCBI_PARAM_DECL (string, PSG, auth_token)
 
 NCBI_PARAM_DECL (string, PSG, admin_auth_token_name)
 
 NCBI_PARAM_DECL (string, PSG, admin_auth_token)
 
 NCBI_PARAM_DECL (bool, PSG, stats)
 
typedef NCBI_PARAM_TYPE (PSG, stats) TPSG_Stats
 
 NCBI_PARAM_DECL (double, PSG, stats_period)
 
typedef NCBI_PARAM_TYPE (PSG, stats_period) TPSG_StatsPeriod
 
 NCBI_PARAM_DECL (double, PSG, throttle_relaxation_period)
 
 NCBI_PARAM_DECL (unsigned, PSG, throttle_by_consecutive_connection_failures)
 
 NCBI_PARAM_DECL (bool, PSG, throttle_hold_until_active_in_lb)
 
 NCBI_PARAM_DECL (string, PSG, throttle_by_connection_error_rate)
 
 NCBI_PARAM_ENUM_DECL (EPSG_DebugPrintout, PSG, debug_printout)
 
 NCBI_PARAM_ENUM_DECL (EPSG_UseCache, PSG, use_cache)
 
 NCBI_PARAM_ENUM_DECL (EPSG_PsgClientMode, PSG, internal_psg_client_mode)
 

Macro Definition Documentation

◆ PSG_PARAM_VALUE_DEF_ADJUST

#define PSG_PARAM_VALUE_DEF_ADJUST (   type,
  section,
  name,
  default_value 
)
Value:
NCBI_PARAM_DEF(type, section, name, default_value); \
template <> \
typename SPSG_ParamValue<NCBI_PARAM_TYPE(section, name)>::TValue \
SPSG_ParamValue<NCBI_PARAM_TYPE(section, name)>::sm_Adjust(SPSG_ParamValue<NCBI_PARAM_TYPE(section, name)>::TValue value)
char value[7]
Definition: config.c:431
#define NCBI_PARAM_DEF(type, section, name, default_value)
Parameter definition.
Definition: ncbi_param.hpp:206
typedef NCBI_PARAM_TYPE(PSG, rd_buf_size) TPSG_RdBufSize
Definition: type.c:6

Definition at line 261 of file misc.hpp.

◆ PSG_PARAM_VALUE_DEF_MIN

#define PSG_PARAM_VALUE_DEF_MIN (   type,
  section,
  name,
  default_value,
  min_value 
)
Value:
PSG_PARAM_VALUE_DEF_ADJUST(type, section, name, default_value) \
{ \
if (value >= min_value) return value; \
ERR_POST(Warning << "[" #section "] " #name " ('" << value << "')" \
" was increased to the minimum allowed value ('" #min_value "')"); \
return min_value; \
}
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
#define PSG_PARAM_VALUE_DEF_ADJUST(type, section, name, default_value)
Definition: misc.hpp:261
#define min_value(a, b)
Definition: ncbi_c_log.c:140

Definition at line 267 of file misc.hpp.

◆ PSG_PARAM_VALUE_TYPE

#define PSG_PARAM_VALUE_TYPE (   section,
  name 
)    SPSG_ParamValue<NCBI_PARAM_TYPE(section, name)>

Definition at line 259 of file misc.hpp.

Typedef Documentation

◆ TPSG_AdminAuthToken

using TPSG_AdminAuthToken = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , admin_auth_token )>

Definition at line 356 of file misc.hpp.

◆ TPSG_AdminAuthTokenName

using TPSG_AdminAuthTokenName = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , admin_auth_token_name )>

Definition at line 353 of file misc.hpp.

◆ TPSG_AuthToken

using TPSG_AuthToken = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , auth_token )>

Definition at line 350 of file misc.hpp.

◆ TPSG_AuthTokenName

using TPSG_AuthTokenName = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , auth_token_name )>

Definition at line 347 of file misc.hpp.

◆ TPSG_DebugPrintout

using TPSG_DebugPrintout = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , debug_printout )>

Definition at line 378 of file misc.hpp.

◆ TPSG_IoTimerPeriod

using TPSG_IoTimerPeriod = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , io_timer_period )>

Definition at line 305 of file misc.hpp.

◆ TPSG_MaxConcurrentRequestsPerServer

using TPSG_MaxConcurrentRequestsPerServer = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , max_concurrent_requests_per_server )>

Definition at line 293 of file misc.hpp.

◆ TPSG_MaxConcurrentSubmits

using TPSG_MaxConcurrentSubmits = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , max_concurrent_submits )>

Definition at line 287 of file misc.hpp.

◆ TPSG_PsgClientMode

using TPSG_PsgClientMode = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , internal_psg_client_mode )>

Definition at line 387 of file misc.hpp.

◆ TPSG_RefusedStreamRetries

using TPSG_RefusedStreamRetries = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , refused_stream_retries )>

Definition at line 320 of file misc.hpp.

◆ TPSG_RequestRetries

using TPSG_RequestRetries = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , request_retries )>

Definition at line 317 of file misc.hpp.

◆ TPSG_RequestsPerIo

using TPSG_RequestsPerIo = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , requests_per_io )>

Definition at line 314 of file misc.hpp.

◆ TPSG_Service

using TPSG_Service = NCBI_PARAM_TYPE(PSG, service)

Definition at line 344 of file misc.hpp.

◆ TPSG_ThrottleMaxFailures

using TPSG_ThrottleMaxFailures = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , throttle_by_consecutive_connection_failures )>

Definition at line 368 of file misc.hpp.

◆ TPSG_ThrottlePeriod

using TPSG_ThrottlePeriod = NCBI_PARAM_TYPE(PSG, throttle_relaxation_period)

Definition at line 365 of file misc.hpp.

◆ TPSG_ThrottleThreshold

using TPSG_ThrottleThreshold = NCBI_PARAM_TYPE(PSG, throttle_by_connection_error_rate)

Definition at line 374 of file misc.hpp.

◆ TPSG_ThrottleUntilDiscovery

using TPSG_ThrottleUntilDiscovery = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , throttle_hold_until_active_in_lb )>

Definition at line 371 of file misc.hpp.

◆ TPSG_UseCache

using TPSG_UseCache = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , use_cache )>

Definition at line 382 of file misc.hpp.

◆ TPSG_UserRequestIds

using TPSG_UserRequestIds = SPSG_ParamValue<NCBI_PARAM_TYPE( PSG , user_request_ids )>

Definition at line 326 of file misc.hpp.

Enumeration Type Documentation

◆ EPSG_DebugPrintout

enum EPSG_DebugPrintout
strong
Enumerator
eNone 
eSome 
eAll 

Definition at line 376 of file misc.hpp.

◆ EPSG_PsgClientMode

enum EPSG_PsgClientMode
strong
Enumerator
eOff 
ePerformance 

Definition at line 385 of file misc.hpp.

◆ EPSG_UseCache

enum EPSG_UseCache
strong
Enumerator
eDefault 
eNo 
eYes 

Definition at line 380 of file misc.hpp.

Function Documentation

◆ NCBI_PARAM_DECL() [1/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
fail_on_unknown_chunks   
)

◆ NCBI_PARAM_DECL() [2/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
fail_on_unknown_items   
)

◆ NCBI_PARAM_DECL() [3/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
https   
)

◆ NCBI_PARAM_DECL() [4/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
stats   
)

◆ NCBI_PARAM_DECL() [5/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
throttle_hold_until_active_in_lb   
)

◆ NCBI_PARAM_DECL() [6/33]

NCBI_PARAM_DECL ( bool  ,
PSG  ,
user_request_ids   
)

◆ NCBI_PARAM_DECL() [7/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
competitive_after   
)

◆ NCBI_PARAM_DECL() [8/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
io_timer_period   
)

◆ NCBI_PARAM_DECL() [9/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
no_servers_retry_delay   
)

◆ NCBI_PARAM_DECL() [10/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
rebalance_time   
)

◆ NCBI_PARAM_DECL() [11/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
request_timeout   
)

◆ NCBI_PARAM_DECL() [12/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
stats_period   
)

◆ NCBI_PARAM_DECL() [13/33]

NCBI_PARAM_DECL ( double  ,
PSG  ,
throttle_relaxation_period   
)

◆ NCBI_PARAM_DECL() [14/33]

NCBI_PARAM_DECL ( size_t  ,
PSG  ,
requests_per_io   
)

◆ NCBI_PARAM_DECL() [15/33]

NCBI_PARAM_DECL ( size_t  ,
PSG  ,
wr_buf_size   
)

◆ NCBI_PARAM_DECL() [16/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
admin_auth_token   
)

◆ NCBI_PARAM_DECL() [17/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
admin_auth_token_name   
)

◆ NCBI_PARAM_DECL() [18/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
auth_token   
)

◆ NCBI_PARAM_DECL() [19/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
auth_token_name   
)

◆ NCBI_PARAM_DECL() [20/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
request_user_args   
)

◆ NCBI_PARAM_DECL() [21/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
service   
)

◆ NCBI_PARAM_DECL() [22/33]

NCBI_PARAM_DECL ( string  ,
PSG  ,
throttle_by_connection_error_rate   
)

◆ NCBI_PARAM_DECL() [23/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
localhost_preference   
)

◆ NCBI_PARAM_DECL() [24/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
max_concurrent_requests_per_server   
)

◆ NCBI_PARAM_DECL() [25/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
max_concurrent_streams   
)

◆ NCBI_PARAM_DECL() [26/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
max_concurrent_submits   
)

◆ NCBI_PARAM_DECL() [27/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
max_sessions   
)

◆ NCBI_PARAM_DECL() [28/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
num_io   
)

◆ NCBI_PARAM_DECL() [29/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
rd_buf_size   
)

◆ NCBI_PARAM_DECL() [30/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
reader_timeout   
)

◆ NCBI_PARAM_DECL() [31/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
refused_stream_retries   
)

◆ NCBI_PARAM_DECL() [32/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
request_retries   
)

◆ NCBI_PARAM_DECL() [33/33]

NCBI_PARAM_DECL ( unsigned  ,
PSG  ,
throttle_by_consecutive_connection_failures   
)

◆ NCBI_PARAM_ENUM_DECL() [1/3]

NCBI_PARAM_ENUM_DECL ( EPSG_DebugPrintout  ,
PSG  ,
debug_printout   
)

◆ NCBI_PARAM_ENUM_DECL() [2/3]

NCBI_PARAM_ENUM_DECL ( EPSG_PsgClientMode  ,
PSG  ,
internal_psg_client_mode   
)

◆ NCBI_PARAM_ENUM_DECL() [3/3]

NCBI_PARAM_ENUM_DECL ( EPSG_UseCache  ,
PSG  ,
use_cache   
)

◆ NCBI_PARAM_TYPE() [1/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
competitive_after   
)

◆ NCBI_PARAM_TYPE() [2/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
fail_on_unknown_chunks   
)

◆ NCBI_PARAM_TYPE() [3/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
fail_on_unknown_items   
)

◆ NCBI_PARAM_TYPE() [4/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
https   
)

◆ NCBI_PARAM_TYPE() [5/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
localhost_preference   
)

◆ NCBI_PARAM_TYPE() [6/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
max_concurrent_streams   
)

◆ NCBI_PARAM_TYPE() [7/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
max_sessions   
)

◆ NCBI_PARAM_TYPE() [8/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
no_servers_retry_delay   
)

◆ NCBI_PARAM_TYPE() [9/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
num_io   
)

◆ NCBI_PARAM_TYPE() [10/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
rd_buf_size   
)

◆ NCBI_PARAM_TYPE() [11/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
reader_timeout   
)

◆ NCBI_PARAM_TYPE() [12/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
rebalance_time   
)

◆ NCBI_PARAM_TYPE() [13/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
request_timeout   
)

◆ NCBI_PARAM_TYPE() [14/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
request_user_args   
)

◆ NCBI_PARAM_TYPE() [15/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
stats   
)

◆ NCBI_PARAM_TYPE() [16/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
stats_period   
)

◆ NCBI_PARAM_TYPE() [17/17]

typedef NCBI_PARAM_TYPE ( PSG  ,
wr_buf_size   
)
Modified on Sun Mar 03 03:10:40 2024 by modify_doxy.py rev. 669887