NCBI C++ ToolKit
|
Search Toolkit Book for SNetScheduleAPIImpl
#include "netschedule_api_impl.hpp"
(Private to src/connect/services
.)
Classes | |
struct | SServerParamsSync |
Public Types | |
typedef CNetScheduleAPI::TQueueParams | TQueueParams |
typedef map< string, string > | TAuthParams |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Member Functions | |
SNetScheduleAPIImpl (CSynRegistryBuilder registry_builder, const string §ion, const string &service_name=kEmptyStr, const string &client_name=kEmptyStr, const string &queue_name=kEmptyStr, bool wn=false, bool try_config=true) | |
SNetScheduleAPIImpl (SNetServerInPool *server, SNetScheduleAPIImpl *parent) | |
~SNetScheduleAPIImpl () | |
CNetScheduleServerListener * | GetListener () |
CNetScheduleAPI::EJobStatus | GetJobStatus (string cmd, const CNetScheduleJob &job, time_t *job_exptime, ENetScheduleQueuePauseMode *pause_mode) |
const CNetScheduleAPI::SServerParams & | GetServerParams () |
void | GetQueueParams (const string &queue_name, TQueueParams &queue_params) |
void | GetQueueParams (TQueueParams &queue_params) |
CNetServer | GetServer (const string &job_key) |
CNetServer | GetServer (const CNetScheduleJob &job) |
template<class TJob > | |
string | ExecOnJobServer (const TJob &job, const string &cmd, ESwitch roe=eDefault) |
bool | GetServerByNode (const string &ns_node, CNetServer *server) |
void | AllocNotificationThread () |
void | StartNotificationThread () |
void | x_ClearNode () |
void | UpdateAuthString () |
void | UseOldStyleAuth () |
void | SetAuthParam (const string ¶m_name, const string ¶m_value) |
CCompoundIDPool | GetCompoundIDPool () |
void | Init (CSynRegistry ®istry, SRegSynonyms §ions) |
void | InitAffinities (CSynRegistry ®istry, const SRegSynonyms §ions) |
string | MakeAuthString () |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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 |
Private Types | |
enum | EMode { fWnCompatible = (0 << 0) , fNonWnCompatible = (1 << 0) , fConfigLoading = (1 << 1) , fWorkerNode = fWnCompatible , fNetSchedule = fNonWnCompatible } |
typedef int | TMode |
Static Private Member Functions | |
static TMode | GetMode (bool wn, bool try_config) |
Private Attributes | |
const TMode | m_Mode |
Additional Inherited Members | |
![]() | |
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 void | EnableDebugDump (bool on) |
![]() | |
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... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 285 of file netschedule_api_impl.hpp.
typedef map<string, string> SNetScheduleAPIImpl::TAuthParams |
Definition at line 381 of file netschedule_api_impl.hpp.
|
private |
Definition at line 295 of file netschedule_api_impl.hpp.
Definition at line 326 of file netschedule_api_impl.hpp.
|
private |
Enumerator | |
---|---|
fWnCompatible | |
fNonWnCompatible | |
fConfigLoading | |
fWorkerNode | |
fNetSchedule |
Definition at line 288 of file netschedule_api_impl.hpp.
SNetScheduleAPIImpl::SNetScheduleAPIImpl | ( | CSynRegistryBuilder | registry_builder, |
const string & | section, | ||
const string & | service_name = kEmptyStr , |
||
const string & | client_name = kEmptyStr , |
||
const string & | queue_name = kEmptyStr , |
||
bool | wn = false , |
||
bool | try_config = true |
||
) |
Definition at line 712 of file netschedule_api.cpp.
References SNetServiceImpl::Create(), fNonWnCompatible, Init(), kNetScheduleAPIDriverName, m_Mode, m_Service, and m_SharedData.
Referenced by CNetScheduleAPICF::CreateInstance(), CNetScheduleAPIExt::CreateNoCfgLoad(), CNetScheduleAPIExt::CreateWnCompat(), and CNetScheduleAPIExt::GetServer().
SNetScheduleAPIImpl::SNetScheduleAPIImpl | ( | SNetServerInPool * | server, |
SNetScheduleAPIImpl * | parent | ||
) |
Definition at line 726 of file netschedule_api.cpp.
SNetScheduleAPIImpl::~SNetScheduleAPIImpl | ( | ) |
Definition at line 333 of file netschedule_api.cpp.
References CAtomicCounter::Add(), CThread::Join(), m_NotificationThread, m_NotificationThreadMutex, m_NotificationThreadStartStopCounter, SNetScheduleNotificationThread::m_Receiver, SNetScheduleNotificationThread::m_StopThread, NULL, SNetScheduleNotificationReceiver::port, and CDatagramSocket::Send().
void SNetScheduleAPIImpl::AllocNotificationThread | ( | ) |
Definition at line 319 of file netschedule_api.cpp.
References m_NotificationThread, m_NotificationThreadMutex, and NULL.
|
inline |
Definition at line 342 of file netschedule_api_impl.hpp.
References cmd, eDefault, and eOn.
Referenced by GetJobStatus(), and CNetScheduleNotificationHandler::RequestJobWatching().
|
inline |
Definition at line 362 of file netschedule_api_impl.hpp.
Referenced by SGridWorkerNodeImpl::OfflineRun().
CNetScheduleAPI::EJobStatus SNetScheduleAPIImpl::GetJobStatus | ( | string | cmd, |
const CNetScheduleJob & | job, | ||
time_t * | job_exptime, | ||
ENetScheduleQueuePauseMode * | pause_mode | ||
) |
Definition at line 975 of file netschedule_api.cpp.
References cmd, CNetScheduleAPI::eJobNotFound, CNetScheduleException::eJobNotFound, ExecOnJobServer(), g_AppendClientIPSessionIDHitID(), CException::GetErrCode(), CNetScheduleNewJob::job_id, NULL, s_SetJobExpTime(), s_SetPauseMode(), and CNetScheduleAPI::StringToStatus().
|
inline |
Definition at line 314 of file netschedule_api_impl.hpp.
Referenced by Init(), UpdateAuthString(), and CNetScheduleNotificationHandler::WaitForJobCompletion().
Definition at line 297 of file netschedule_api_impl.hpp.
void SNetScheduleAPIImpl::GetQueueParams | ( | const string & | queue_name, |
TQueueParams & | queue_params | ||
) |
Definition at line 1076 of file netschedule_api.cpp.
References cmd, CNetService::FindServerAndExec(), g_AppendClientIPSessionIDHitID(), CUrlArgs::GetArgs(), ITERATE, m_Queue, m_Service, SNetServiceImpl::m_ServiceName, and CNetServer::SExecResult::response.
void SNetScheduleAPIImpl::GetQueueParams | ( | TQueueParams & | queue_params | ) |
Definition at line 1106 of file netschedule_api.cpp.
References cmd, CNetService::FindServerAndExec(), g_AppendClientIPSessionIDHitID(), CUrlArgs::GetArgs(), ITERATE, m_Service, and CNetServer::SExecResult::response.
|
inline |
Definition at line 336 of file netschedule_api_impl.hpp.
References CNetScheduleNewJob::job_id, NULL, and CNetScheduleJob::server.
|
inline |
Definition at line 330 of file netschedule_api_impl.hpp.
References CNetScheduleKey::host, and CNetScheduleKey::port.
Referenced by CNetScheduleNotificationHandler::WaitForJobCompletion().
bool SNetScheduleAPIImpl::GetServerByNode | ( | const string & | ns_node, |
CNetServer * | server | ||
) |
Definition at line 1005 of file netschedule_api.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), SNetScheduleSharedData::m_ServerByNode, SNetScheduleSharedData::m_ServerByNodeMutex, SNetServiceImpl::m_ServerPool, m_Service, m_SharedData, and SNetServerPoolImpl::ReturnServer().
Referenced by CNetScheduleNotificationHandler::CheckRequestJobNotification().
|
inline |
Definition at line 324 of file netschedule_api_impl.hpp.
Referenced by CGridClient::GetMaxServerInputSize().
void SNetScheduleAPIImpl::Init | ( | CSynRegistry & | registry, |
SRegSynonyms & | sections | ||
) |
Definition at line 571 of file netschedule_api.cpp.
References fConfigLoading, IRegistry::Get(), SNetServiceImpl::GetClientName(), GetDiagContext(), GetFastLocalTime(), CDiagContext::GetHost(), GetListener(), CDiagContext::GetPID(), CDiagContext::GetStringUID(), InitAffinities(), kEmptyStr, m_ClientNode, m_ClientSession, m_JobGroup, m_JobTtl, m_Mode, m_Queue, m_RetryOnException, m_Service, m_UseEmbeddedStorage, MakeAuthString(), NStr::NumericToString(), registry, CNetScheduleServerListener::Scope(), CNetScheduleServerListener::SetAuthString(), and SetDiagUserAndHost().
Referenced by SNetScheduleAPIImpl().
void SNetScheduleAPIImpl::InitAffinities | ( | CSynRegistry & | registry, |
const SRegSynonyms & | sections | ||
) |
Definition at line 1198 of file netschedule_api.cpp.
References CNetScheduleExecutor::eClaimNewPreferredAffs, CNetScheduleExecutor::eExplicitAffinitiesOnly, CNetScheduleExecutor::ePreferredAffinities, CNetScheduleExecutor::ePreferredAffsOrAnyJob, NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, IRegistry::Get(), kEmptyStr, m_AffinityLadder, m_AffinityList, m_AffinityPreference, NCBI_THROW, registry, and NStr::Split().
Referenced by Init().
string SNetScheduleAPIImpl::MakeAuthString | ( | ) |
Definition at line 470 of file netschedule_api.cpp.
References COMPATIBLE_NETSCHEDULE_VERSION, CNetScheduleAPI::eCT_Admin, CNetScheduleAPI::eCT_Reader, CNetScheduleAPI::eCT_Submitter, CNetScheduleAPI::eCT_WorkerNode, fNonWnCompatible, CNcbiApplicationAPI::InstanceGuard(), ITERATE, m_AuthParams, m_ClientNode, m_ClientSession, m_ClientType, m_Mode, m_ProgramVersion, m_Queue, m_Service, SNetServiceImpl::MakeAuthString(), and version.
Referenced by Init(), and UpdateAuthString().
Definition at line 1183 of file netschedule_api.cpp.
References map_checker< Container >::erase(), m_AuthParams, NStr::PrintableString(), and UpdateAuthString().
Referenced by SGridWorkerNodeImpl::Run().
void SNetScheduleAPIImpl::StartNotificationThread | ( | ) |
Definition at line 327 of file netschedule_api.cpp.
References CAtomicCounter::Add(), m_NotificationThread, m_NotificationThreadStartStopCounter, and CThread::Run().
Referenced by SNetScheduleJobReaderImpl::x_StartNotificationThread().
void SNetScheduleAPIImpl::UpdateAuthString | ( | ) |
Definition at line 1162 of file netschedule_api.cpp.
References GetListener(), SNetServiceImpl::m_ServerPool, m_Service, MakeAuthString(), SNetServerPoolImpl::ResetServerConnections(), and CNetScheduleServerListener::SetAuthString().
Referenced by CNetScheduleAPIExt::AddToClientNode(), SetAuthParam(), and UseOldStyleAuth().
void SNetScheduleAPIImpl::UseOldStyleAuth | ( | ) |
Definition at line 1176 of file netschedule_api.cpp.
References SNetServiceImpl::m_ServerPool, m_Service, SNetServerPoolImpl::m_UseOldStyleAuth, and UpdateAuthString().
void SNetScheduleAPIImpl::x_ClearNode | ( | ) |
Definition at line 347 of file netschedule_api.cpp.
References SSocketAddress::AsString(), cmd, SNetServerImpl::ConnectAndExec(), CNetServiceException::eCommunicationError, CNetService::eIncludePenalized, ERR_POST, g_AppendClientIPSessionIDHitID(), CException::GetErrCode(), CNetService::IsLoadBalanced(), CNetService::Iterate(), SNetServerInPool::m_Address, SNetServerImpl::m_ServerInPool, m_Service, and CException::what().
Referenced by SGridWorkerNodeImpl::x_ClearNode().
CNetScheduleGetJob::TAffinityLadder SNetScheduleAPIImpl::m_AffinityLadder |
Definition at line 398 of file netschedule_api_impl.hpp.
Referenced by InitAffinities(), SNetScheduleJobReaderImpl::ReadNextJob(), and CMainLoopThread::x_GetNextJob().
list<string> SNetScheduleAPIImpl::m_AffinityList |
Definition at line 396 of file netschedule_api_impl.hpp.
Referenced by InitAffinities(), and SNetScheduleExecutorImpl::SNetScheduleExecutorImpl().
CNetScheduleExecutor::EJobAffinityPreference SNetScheduleAPIImpl::m_AffinityPreference = CNetScheduleExecutor::eAnyJob |
Definition at line 395 of file netschedule_api_impl.hpp.
Referenced by SNetScheduleJobReaderImpl::CImpl::CheckEntry(), and InitAffinities().
TAuthParams SNetScheduleAPIImpl::m_AuthParams |
Definition at line 382 of file netschedule_api_impl.hpp.
Referenced by MakeAuthString(), and SetAuthParam().
string SNetScheduleAPIImpl::m_ClientNode |
Definition at line 378 of file netschedule_api_impl.hpp.
Referenced by Init(), MakeAuthString(), CGetStatisticsProcessor::Process(), and SGridWorkerNodeImpl::Run().
string SNetScheduleAPIImpl::m_ClientSession |
Definition at line 379 of file netschedule_api_impl.hpp.
Referenced by Init(), MakeAuthString(), CGetStatisticsProcessor::Process(), and SGridWorkerNodeImpl::Run().
CNetScheduleAPI::EClientType SNetScheduleAPIImpl::m_ClientType = CNetScheduleAPI::eCT_Auto |
Definition at line 371 of file netschedule_api_impl.hpp.
Referenced by MakeAuthString().
CCompoundIDPool SNetScheduleAPIImpl::m_CompoundIDPool |
Definition at line 405 of file netschedule_api_impl.hpp.
string SNetScheduleAPIImpl::m_JobGroup |
Definition at line 400 of file netschedule_api_impl.hpp.
Referenced by Init().
unsigned SNetScheduleAPIImpl::m_JobTtl = 0 |
Definition at line 401 of file netschedule_api_impl.hpp.
Referenced by Init(), CGridClient::Submit(), and CGridClient::WaitForJob().
Definition at line 368 of file netschedule_api_impl.hpp.
Referenced by Init(), MakeAuthString(), and SNetScheduleAPIImpl().
CRef<SNetScheduleNotificationThread> SNetScheduleAPIImpl::m_NotificationThread |
Definition at line 408 of file netschedule_api_impl.hpp.
Referenced by AllocNotificationThread(), SNetScheduleJobReaderImpl::CImpl::CheckEntry(), SNetScheduleJobReaderImpl::InterruptReading(), StartNotificationThread(), and ~SNetScheduleAPIImpl().
CFastMutex SNetScheduleAPIImpl::m_NotificationThreadMutex |
Definition at line 407 of file netschedule_api_impl.hpp.
Referenced by AllocNotificationThread(), and ~SNetScheduleAPIImpl().
CAtomicCounter_WithAutoInit SNetScheduleAPIImpl::m_NotificationThreadStartStopCounter |
Definition at line 409 of file netschedule_api_impl.hpp.
Referenced by StartNotificationThread(), and ~SNetScheduleAPIImpl().
string SNetScheduleAPIImpl::m_ProgramVersion |
Definition at line 377 of file netschedule_api_impl.hpp.
Referenced by MakeAuthString().
string SNetScheduleAPIImpl::m_Queue |
Definition at line 376 of file netschedule_api_impl.hpp.
Referenced by SNetScheduleNotificationThread::CheckNotification(), GetQueueParams(), Init(), and MakeAuthString().
bool SNetScheduleAPIImpl::m_RetryOnException |
Definition at line 373 of file netschedule_api_impl.hpp.
Referenced by Init().
struct SNetScheduleAPIImpl::SServerParamsSync SNetScheduleAPIImpl::m_ServerParamsSync |
CNetService SNetScheduleAPIImpl::m_Service |
Definition at line 374 of file netschedule_api_impl.hpp.
Referenced by g_GetWorkerNodeInfo(), g_GetWorkerNodes(), SGridWorkerNodeImpl::GetClientName(), GetQueueParams(), GetServerByNode(), SGridWorkerNodeImpl::GetServiceName(), Init(), MakeAuthString(), CNetScheduleNotificationHandler::RequestJob(), SNetCacheAPIImpl::SNetCacheAPIImpl(), SNetScheduleAPIImpl(), UpdateAuthString(), UseOldStyleAuth(), and x_ClearNode().
CRef<SNetScheduleSharedData> SNetScheduleAPIImpl::m_SharedData |
Definition at line 372 of file netschedule_api_impl.hpp.
Referenced by GetServerByNode(), and SNetScheduleAPIImpl().
bool SNetScheduleAPIImpl::m_UseEmbeddedStorage |
Definition at line 403 of file netschedule_api_impl.hpp.
Referenced by CGridClient::GetMaxServerInputSize(), Init(), and SGridWorkerNodeImpl::Run().