NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions
psg_client_transport.cpp File Reference
#include <ncbi_pch.hpp>
#include <objtools/pubseq_gateway/client/psg_client.hpp>
#include <memory>
#include <string>
#include <sstream>
#include <list>
#include <vector>
#include <cassert>
#include <exception>
#include <thread>
#include <unordered_map>
#include <type_traits>
#include <utility>
#include <functional>
#include <numeric>
#include <cmath>
#include <corelib/request_status.hpp>
#include "psg_client_transport.hpp"
+ Include dependency graph for psg_client_transport.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eRequest >
 
struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eReplyItem >
 
struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eSkippedBlob >
 
struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eReplyItemStatus >
 
struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eMessage >
 
struct  SPSG_StatsCounters::SGroup< SPSG_StatsCounters::eRetries >
 

Macros

#define __STDC_FORMAT_MACROS
 
#define HTTP_STATUS_HEADER   ":status"
 

Enumerations

enum  EPSG_StatsCountersRetries { ePSG_StatsCountersRetries_Retry , ePSG_StatsCountersRetries_Timeout }
 

Functions

 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, rd_buf_size, 64 *1024, 1024)
 
 PSG_PARAM_VALUE_DEF_MIN (size_t, PSG, wr_buf_size, 64 *1024, 1024)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, max_concurrent_streams, 100, 10)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, max_concurrent_submits, 150, 1)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, max_sessions, 40, 1)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, max_concurrent_requests_per_server, 500, 100)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, num_io, 6, 1)
 
 PSG_PARAM_VALUE_DEF_MIN (unsigned, PSG, reader_timeout, 12, 1)
 
 PSG_PARAM_VALUE_DEF_MIN (double, PSG, rebalance_time, 10.0, 1.0)
 
 PSG_PARAM_VALUE_DEF_MIN (size_t, PSG, requests_per_io, 1, 1)
 
 PSG_PARAM_VALUE_DEF_MIN (double, PSG, io_timer_period, 1.0, 0.1)
 
 NCBI_PARAM_DEF (double, PSG, request_timeout, 10.0)
 
 NCBI_PARAM_DEF (double, PSG, competitive_after, 0.0)
 
 NCBI_PARAM_DEF (unsigned, PSG, request_retries, 2)
 
 NCBI_PARAM_DEF (unsigned, PSG, refused_stream_retries, 2)
 
 NCBI_PARAM_DEF (string, PSG, request_user_args, "")
 
 NCBI_PARAM_DEF (bool, PSG, user_request_ids, false)
 
 NCBI_PARAM_DEF (unsigned, PSG, localhost_preference, 1)
 
 NCBI_PARAM_DEF (bool, PSG, fail_on_unknown_items, false)
 
 NCBI_PARAM_DEF (bool, PSG, fail_on_unknown_chunks, false)
 
 NCBI_PARAM_DEF (bool, PSG, https, false)
 
 NCBI_PARAM_DEF (double, PSG, no_servers_retry_delay, 1.0)
 
 NCBI_PARAM_DEF (bool, PSG, stats, false)
 
 NCBI_PARAM_DEF (double, PSG, stats_period, 0.0)
 
 NCBI_PARAM_DEF_EX (string, PSG, service, "PSG2", eParam_Default, NCBI_PSG_SERVICE)
 
 NCBI_PARAM_DEF_EX (string, PSG, auth_token_name, "WebCubbyUser", eParam_Default, NCBI_PSG_AUTH_TOKEN_NAME)
 
 NCBI_PARAM_DEF_EX (string, PSG, auth_token, "", eParam_Default, NCBI_PSG_AUTH_TOKEN)
 
 NCBI_PARAM_DEF_EX (string, PSG, admin_auth_token_name, "AdminAuthToken", eParam_Default, NCBI_PSG_ADMIN_AUTH_TOKEN_NAME)
 
 NCBI_PARAM_DEF_EX (string, PSG, admin_auth_token, "", eParam_Default, NCBI_PSG_ADMIN_AUTH_TOKEN)
 
 NCBI_PARAM_DEF (double, PSG, throttle_relaxation_period, 0.0)
 
 NCBI_PARAM_DEF (unsigned, PSG, throttle_by_consecutive_connection_failures, 0)
 
 NCBI_PARAM_DEF (bool, PSG, throttle_hold_until_active_in_lb, false)
 
 NCBI_PARAM_DEF (string, PSG, throttle_by_connection_error_rate, "")
 
 NCBI_PARAM_ENUM_ARRAY (EPSG_DebugPrintout, PSG, debug_printout)
 
 NCBI_PARAM_ENUM_DEF (EPSG_DebugPrintout, PSG, debug_printout, EPSG_DebugPrintout::eNone)
 
 NCBI_PARAM_ENUM_ARRAY (EPSG_UseCache, PSG, use_cache)
 
 NCBI_PARAM_ENUM_DEF (EPSG_UseCache, PSG, use_cache, EPSG_UseCache::eDefault)
 
 NCBI_PARAM_ENUM_ARRAY (EPSG_PsgClientMode, PSG, internal_psg_client_mode)
 
 NCBI_PARAM_ENUM_DEF (EPSG_PsgClientMode, PSG, internal_psg_client_mode, EPSG_PsgClientMode::eOff)
 
uint64_t s_GetStatsPeriod ()
 
EDiagSev s_GetSeverity (const string &severity)
 
auto s_GetCode (const string &code)
 
shared_ptr< SPSG_Statss_GetStats (SPSG_Servers::TTS &servers)
 SPSG_IoCoordinator. More...
 
uint64_t s_GetDiscoveryRepeat (const CServiceDiscovery &service)
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 51 of file psg_client_transport.cpp.

◆ HTTP_STATUS_HEADER

#define HTTP_STATUS_HEADER   ":status"

Definition at line 1049 of file psg_client_transport.cpp.

Enumeration Type Documentation

◆ EPSG_StatsCountersRetries

Enumerator
ePSG_StatsCountersRetries_Retry 
ePSG_StatsCountersRetries_Timeout 

Definition at line 429 of file psg_client_transport.cpp.

Function Documentation

◆ NCBI_PARAM_DEF() [1/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
fail_on_unknown_chunks  ,
false   
)

◆ NCBI_PARAM_DEF() [2/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
fail_on_unknown_items  ,
false   
)

◆ NCBI_PARAM_DEF() [3/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
https  ,
false   
)

◆ NCBI_PARAM_DEF() [4/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
stats  ,
false   
)

◆ NCBI_PARAM_DEF() [5/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
throttle_hold_until_active_in_lb  ,
false   
)

◆ NCBI_PARAM_DEF() [6/17]

NCBI_PARAM_DEF ( bool  ,
PSG  ,
user_request_ids  ,
false   
)

◆ NCBI_PARAM_DEF() [7/17]

NCBI_PARAM_DEF ( double  ,
PSG  ,
competitive_after  ,
0.  0 
)

◆ NCBI_PARAM_DEF() [8/17]

NCBI_PARAM_DEF ( double  ,
PSG  ,
no_servers_retry_delay  ,
1.  0 
)

◆ NCBI_PARAM_DEF() [9/17]

NCBI_PARAM_DEF ( double  ,
PSG  ,
request_timeout  ,
10.  0 
)

◆ NCBI_PARAM_DEF() [10/17]

NCBI_PARAM_DEF ( double  ,
PSG  ,
stats_period  ,
0.  0 
)

◆ NCBI_PARAM_DEF() [11/17]

NCBI_PARAM_DEF ( double  ,
PSG  ,
throttle_relaxation_period  ,
0.  0 
)

◆ NCBI_PARAM_DEF() [12/17]

NCBI_PARAM_DEF ( string  ,
PSG  ,
request_user_args  ,
""   
)

◆ NCBI_PARAM_DEF() [13/17]

NCBI_PARAM_DEF ( string  ,
PSG  ,
throttle_by_connection_error_rate  ,
""   
)

◆ NCBI_PARAM_DEF() [14/17]

NCBI_PARAM_DEF ( unsigned  ,
PSG  ,
localhost_preference  ,
 
)

◆ NCBI_PARAM_DEF() [15/17]

NCBI_PARAM_DEF ( unsigned  ,
PSG  ,
refused_stream_retries  ,
 
)

◆ NCBI_PARAM_DEF() [16/17]

NCBI_PARAM_DEF ( unsigned  ,
PSG  ,
request_retries  ,
 
)

◆ NCBI_PARAM_DEF() [17/17]

NCBI_PARAM_DEF ( unsigned  ,
PSG  ,
throttle_by_consecutive_connection_failures  ,
 
)

◆ NCBI_PARAM_DEF_EX() [1/5]

NCBI_PARAM_DEF_EX ( string  ,
PSG  ,
admin_auth_token  ,
""  ,
eParam_Default  ,
NCBI_PSG_ADMIN_AUTH_TOKEN   
)

◆ NCBI_PARAM_DEF_EX() [2/5]

NCBI_PARAM_DEF_EX ( string  ,
PSG  ,
admin_auth_token_name  ,
"AdminAuthToken"  ,
eParam_Default  ,
NCBI_PSG_ADMIN_AUTH_TOKEN_NAME   
)

◆ NCBI_PARAM_DEF_EX() [3/5]

NCBI_PARAM_DEF_EX ( string  ,
PSG  ,
auth_token  ,
""  ,
eParam_Default  ,
NCBI_PSG_AUTH_TOKEN   
)

◆ NCBI_PARAM_DEF_EX() [4/5]

NCBI_PARAM_DEF_EX ( string  ,
PSG  ,
auth_token_name  ,
"WebCubbyUser"  ,
eParam_Default  ,
NCBI_PSG_AUTH_TOKEN_NAME   
)

◆ NCBI_PARAM_DEF_EX() [5/5]

NCBI_PARAM_DEF_EX ( string  ,
PSG  ,
service  ,
"PSG2"  ,
eParam_Default  ,
NCBI_PSG_SERVICE   
)

◆ NCBI_PARAM_ENUM_ARRAY() [1/3]

NCBI_PARAM_ENUM_ARRAY ( EPSG_DebugPrintout  ,
PSG  ,
debug_printout   
)

Definition at line 94 of file psg_client_transport.cpp.

References eAll, eNone, and eSome.

◆ NCBI_PARAM_ENUM_ARRAY() [2/3]

NCBI_PARAM_ENUM_ARRAY ( EPSG_PsgClientMode  ,
PSG  ,
internal_psg_client_mode   
)

Definition at line 111 of file psg_client_transport.cpp.

References eOff, and ePerformance.

◆ NCBI_PARAM_ENUM_ARRAY() [3/3]

NCBI_PARAM_ENUM_ARRAY ( EPSG_UseCache  ,
PSG  ,
use_cache   
)

Definition at line 102 of file psg_client_transport.cpp.

References eDefault, eNo, and eYes.

◆ NCBI_PARAM_ENUM_DEF() [1/3]

NCBI_PARAM_ENUM_DEF ( EPSG_DebugPrintout  ,
PSG  ,
debug_printout  ,
EPSG_DebugPrintout::eNone   
)

◆ NCBI_PARAM_ENUM_DEF() [2/3]

NCBI_PARAM_ENUM_DEF ( EPSG_PsgClientMode  ,
PSG  ,
internal_psg_client_mode  ,
EPSG_PsgClientMode::eOff   
)

◆ NCBI_PARAM_ENUM_DEF() [3/3]

NCBI_PARAM_ENUM_DEF ( EPSG_UseCache  ,
PSG  ,
use_cache  ,
EPSG_UseCache::eDefault   
)

◆ PSG_PARAM_VALUE_DEF_MIN() [1/11]

PSG_PARAM_VALUE_DEF_MIN ( double  ,
PSG  ,
io_timer_period  ,
1.  0,
0.  1 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [2/11]

PSG_PARAM_VALUE_DEF_MIN ( double  ,
PSG  ,
rebalance_time  ,
10.  0,
1.  0 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [3/11]

PSG_PARAM_VALUE_DEF_MIN ( size_t  ,
PSG  ,
requests_per_io  ,
,
 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [4/11]

PSG_PARAM_VALUE_DEF_MIN ( size_t  ,
PSG  ,
wr_buf_size  ,
64 *  1024,
1024   
)

◆ PSG_PARAM_VALUE_DEF_MIN() [5/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
max_concurrent_requests_per_server  ,
500  ,
100   
)

◆ PSG_PARAM_VALUE_DEF_MIN() [6/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
max_concurrent_streams  ,
100  ,
10   
)

◆ PSG_PARAM_VALUE_DEF_MIN() [7/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
max_concurrent_submits  ,
150  ,
 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [8/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
max_sessions  ,
40  ,
 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [9/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
num_io  ,
,
 
)

◆ PSG_PARAM_VALUE_DEF_MIN() [10/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
rd_buf_size  ,
64 *  1024,
1024   
)

◆ PSG_PARAM_VALUE_DEF_MIN() [11/11]

PSG_PARAM_VALUE_DEF_MIN ( unsigned  ,
PSG  ,
reader_timeout  ,
12  ,
 
)

◆ s_GetCode()

auto s_GetCode ( const string code)

Definition at line 869 of file psg_client_transport.cpp.

Referenced by SPSG_Request::UpdateItem().

◆ s_GetDiscoveryRepeat()

uint64_t s_GetDiscoveryRepeat ( const CServiceDiscovery service)

◆ s_GetSeverity()

EDiagSev s_GetSeverity ( const string severity)

◆ s_GetStats()

shared_ptr<SPSG_Stats> s_GetStats ( SPSG_Servers::TTS servers)

SPSG_IoCoordinator.

Definition at line 1879 of file psg_client_transport.cpp.

◆ s_GetStatsPeriod()

uint64_t s_GetStatsPeriod ( )

Definition at line 586 of file psg_client_transport.cpp.

References SecondsToMs().

Modified on Fri Feb 23 11:48:53 2024 by modify_doxy.py rev. 669887