NCBI C++ ToolKit
|
Search Toolkit Book for CNetService
#include <connect/services/netservice_api.hpp>
Public Types | |
enum | EIterationMode { eSortByLoad , eRandomize , eRoundRobin , eIncludePenalized } |
enum | ECmdOutputStyle { eSingleLineOutput , eUrlEncodedOutput , eMultilineOutput , eMultilineOutput_NoHeaders , eMultilineOutput_NetCacheStyle } |
typedef SNetServiceImpl * | TInstance |
using | TEventHandler = function< bool(const string &, CNetServer)> |
Static Public Member Functions | |
static void | AllowXSiteConnections () |
static bool | IsUsingXSiteProxy () |
static CNetService | Create (const string &api_name, const string &service_name, const string &client_name) |
Protected Attributes | |
CNetRef< SNetServiceImpl > | m_Impl |
Definition at line 85 of file netservice_api.hpp.
using CNetService::TEventHandler = function<bool(const string&, CNetServer)> |
Definition at line 136 of file netservice_api.hpp.
typedef SNetServiceImpl* CNetService::TInstance |
Definition at line 87 of file netservice_api.hpp.
Enumerator | |
---|---|
eSingleLineOutput | |
eUrlEncodedOutput | |
eMultilineOutput | |
eMultilineOutput_NoHeaders | |
eMultilineOutput_NetCacheStyle |
Definition at line 121 of file netservice_api.hpp.
Enumerator | |
---|---|
eSortByLoad | |
eRandomize | |
eRoundRobin | |
eIncludePenalized |
Definition at line 93 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
static |
Referenced by NAutomation::CAutomationProc::ExecAllowXSite(), and CGridCommandLineInterfaceApp::Run().
CNetService CNetService::Clone | ( | const string & | name | ) |
Definition at line 1378 of file netservice_api.cpp.
References _ASSERT, SNetServiceImpl::Clone(), and m_Impl.
Referenced by Create(), and SNetStorageRPC::GetServiceIfLocator().
|
static |
Definition at line 1455 of file netservice_api.cpp.
References Clone(), and SNetServiceImpl::Create().
Referenced by CGridCommandLineInterfaceApp::Cmd_Discover(), and g_DiscoverService().
CNetServiceIterator CNetService::ExcludeServer | ( | CNetServer::TInstance | server | ) |
Start iteration excluding 'server' (return the next server after 'server' or NULL).
Definition at line 1316 of file netservice_api.cpp.
References ITERATE, m_Impl, SNetServerImpl::m_ServerInPool, SDiscoveredServers::m_Servers, and NULL.
Referenced by CCgi2RCgiApp::GetStatus().
Definition at line 913 of file netservice_api.cpp.
References cmd, eIncludePenalized, and Iterate().
Referenced by SNetCacheAdminImpl::ExecOnAllServers(), g_ResumeNetSchedule(), and g_SuspendNetSchedule().
CNetServiceIterator CNetService::FindServer | ( | INetServerFinder * | finder, |
CNetService::EIterationMode | mode = eSortByLoad |
||
) |
Definition at line 1338 of file netservice_api.cpp.
References INetServerFinder::Consider(), CNetServiceException::eCommunicationError, CException::GetErrCode(), Iterate(), LOG_POST, and CException::what().
Referenced by CNetScheduleNotificationHandler::RequestJob().
CNetServer::SExecResult CNetService::FindServerAndExec | ( | const string & | cmd, |
bool | multiline_output = false |
||
) |
Definition at line 907 of file netservice_api.cpp.
Referenced by SNetScheduleAPIImpl::GetQueueParams(), SNetCacheAPIImpl::InitiateWriteCmd(), and SNetScheduleAPIImpl::SServerParamsSync::operator()().
CNetServer CNetService::GetServer | ( | const string & | host, |
unsigned short | port | ||
) |
Definition at line 838 of file netservice_api.cpp.
References m_Impl.
CNetServer CNetService::GetServer | ( | unsigned | host, |
unsigned short | port | ||
) |
Definition at line 844 of file netservice_api.cpp.
References m_Impl.
Referenced by SNetCacheAPIImpl::ExecMirrorAware(), and CCgi2RCgiApp::GetStatus().
CNetServerPool CNetService::GetServerPool | ( | ) |
Definition at line 734 of file netservice_api.cpp.
References m_Impl.
Referenced by CStringOrBlobStorageReader::CStringOrBlobStorageReader(), CNetCacheAPI::SetCommunicationTimeout(), CNetScheduleAPI::SetCommunicationTimeout(), CGridCommandLineInterfaceApp::SetUp_NetCacheCmd(), and CGridCommandLineInterfaceApp::SetUp_NetScheduleCmd().
Definition at line 729 of file netservice_api.cpp.
References m_Impl.
Referenced by SNetCacheAPIImpl::ExecMirrorAware(), CDataCrawlerCache::GetCompoundKey(), SNetCacheAPIImpl::Init(), SNetCacheAPIImpl::InitiateWriteCmd(), CGetStatisticsProcessor::Process(), and NDirectNetStorageImpl::CNetCache::SetLocator().
bool CNetService::IsLoadBalanced | ( | ) | const |
Definition at line 739 of file netservice_api.cpp.
References m_Impl.
Referenced by CGridCommandLineInterfaceApp::Cmd_PutBlob(), CGridCommandLineInterfaceApp::Cmd_ServerInfo(), SNetCacheAPIImpl::ExecMirrorAware(), g_ExecToJson(), SNetCacheAPIImpl::InitiateWriteCmd(), PrintCmdOutput(), CGridCommandLineInterfaceApp::PrintNetStorageServerInfo(), and SNetScheduleAPIImpl::x_ClearNode().
CNetServiceIterator CNetService::Iterate | ( | CNetServer::TInstance | priority_server | ) |
Definition at line 1272 of file netservice_api.cpp.
References m_Impl.
CNetServiceIterator CNetService::Iterate | ( | CNetService::EIterationMode | mode = eSortByLoad | ) |
Definition at line 1248 of file netservice_api.cpp.
References eIncludePenalized, eRoundRobin, eSortByLoad, m_Impl, SDiscoveredServers::m_Servers, SDiscoveredServers::m_SuppressedBegin, and NCBI_THROW.
Referenced by SNetCacheMirrorTraversal::BeginIteration(), SRandomServiceTraversal::BeginIteration(), CGridCommandLineInterfaceApp::Cmd_Discover(), CGridCommandLineInterfaceApp::Cmd_Resume(), CGridCommandLineInterfaceApp::Cmd_ServerInfo(), CGridCommandLineInterfaceApp::Cmd_Stats(), CGridCommandLineInterfaceApp::Cmd_Suspend(), NAutomation::SNetCacheServer::Create(), NAutomation::SNetScheduleServer::Create(), NAutomation::SNetStorageServer::Create(), SNetStorageRPC::Exchange(), NAutomation::SNetCacheService::ExecGetServers(), NAutomation::SNetScheduleService::ExecGetServers(), NAutomation::SNetStorageService::ExecGetServers(), SNetCacheAPIImpl::ExecMirrorAware(), ExecOnAllServers(), FindServer(), g_ExecToJson(), g_GetWorkerNodeInfo(), g_GetWorkerNodes(), NAutomation::SNetServiceBase::GetServer(), SNetCacheMirrorTraversal::NextServer(), PrintCmdOutput(), CGridCommandLineInterfaceApp::PrintNetScheduleStats(), CGridCommandLineInterfaceApp::PrintNetScheduleStats_Generic(), CGridCommandLineInterfaceApp::PrintNetStorageServerConfig(), CGridCommandLineInterfaceApp::PrintNetStorageServerInfo(), SNetStorageObjectRPC::Read(), SNetStorageObjectRPC::Relocate(), CGridCommandLineInterfaceApp::ShutdownNetStorageServer(), and SNetScheduleAPIImpl::x_ClearNode().
CNetServiceIterator CNetService::IterateByWeight | ( | const string & | key | ) |
Definition at line 1298 of file netservice_api.cpp.
References CChecksum::AddChars(), CChecksum::eCRC32, CChecksum::GetChecksum(), ncbi::grid::netcache::search::fields::key, m_Impl, SDiscoveredServers::m_Servers, SDiscoveredServers::m_SuppressedBegin, and NCBI_THROW.
Referenced by SWeightedServiceTraversal::BeginIteration().
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
|
inline |
Definition at line 87 of file netservice_api.hpp.
void CNetService::PrintCmdOutput | ( | const string & | cmd, |
CNcbiOstream & | output_stream, | ||
CNetService::ECmdOutputStyle | output_style, | ||
CNetService::EIterationMode | iteration_mode = CNetService::eSortByLoad |
||
) |
Definition at line 749 of file netservice_api.cpp.
References cmd, eMultilineOutput_NetCacheStyle, eMultilineOutput_NoHeaders, eSingleLineOutput, eUrlEncodedOutput, CUrlArgs::GetArgs(), IsLoadBalanced(), Iterate(), ITERATE, and output.
Referenced by CGridCommandLineInterfaceApp::Cmd_Exec(), CGridCommandLineInterfaceApp::Cmd_QueueInfo(), CGridCommandLineInterfaceApp::Cmd_ServerInfo(), SNetCacheAdminImpl::PrintCmdOutput(), CGridCommandLineInterfaceApp::PrintNetScheduleStats(), and CGridCommandLineInterfaceApp::PrintNetScheduleStats_Generic().
void CNetService::SetErrorHandler | ( | TEventHandler | error_handler | ) |
Definition at line 1385 of file netservice_api.cpp.
References m_Impl.
void CNetService::SetWarningHandler | ( | TEventHandler | warning_handler | ) |
Definition at line 1390 of file netservice_api.cpp.
References m_Impl.
Referenced by CGridCommandLineInterfaceApp::SetUp_NetScheduleCmd(), NAutomation::SNetCacheService::SNetCacheService(), NAutomation::SNetScheduleService::SNetScheduleService(), and NAutomation::SNetStorageService::SNetStorageService().
|
protected |
Definition at line 87 of file netservice_api.hpp.
Referenced by Clone(), ExcludeServer(), FindServerAndExec(), GetServer(), GetServerPool(), GetServiceName(), IsLoadBalanced(), Iterate(), IterateByWeight(), SetErrorHandler(), and SetWarningHandler().