NCBI C++ ToolKit
|
Search Toolkit Book for CNetScheduleAdmin
#include <connect/services/impl/netschedule_api_int.hpp>
Classes | |
struct | SServerQueueList |
struct | SWorkerNodeInfo |
Private Types | |
enum | EShutdownLevel { eNoShutdown = 0 , eNormalShutdown , eShutdownImmediate , eDie , eDrain } |
Shutdown level. More... | |
enum | EStatisticsOptions { eStatisticsAll , eStatisticsBrief , eStatisticsClients } |
typedef map< string, unsigned > | TStatusMap |
Status map, shows number of jobs in each status. More... | |
typedef map< string, string > | TQueueInfo |
typedef list< SServerQueueList > | TQueueList |
Private Member Functions | |
NCBI_NET_COMPONENT (NetScheduleAdmin) | |
void | StatusSnapshot (TStatusMap &status_map, const string &affinity_token=kEmptyStr, const string &job_group=kEmptyStr) |
Returns statuses for a given affinity token. More... | |
void | CreateQueue (const string &qname, const string &qclass, const string &description=kEmptyStr) |
Create an instance of the given queue class. More... | |
void | DeleteQueue (const string &qname) |
Delete queue Applicable only to queues, created through CreateQueue method. More... | |
void | SwitchToDrainMode (ESwitch on_off) |
Enable server drain mode. More... | |
void | ShutdownServer (EShutdownLevel level=eNormalShutdown) |
Shutdown the server daemon. More... | |
void | CancelAllJobs (const string &job_statuses=kEmptyStr) |
Cancel all jobs in the queue (optionally with particular statuses). More... | |
void | DumpJob (CNcbiOstream &out, const string &job_key) |
CNetServerMultilineCmdOutput | DumpJob (const string &job_key) |
void | ReloadServerConfig () |
void | PrintServerVersion (CNcbiOstream &output_stream) |
Print version string. More... | |
void | GetWorkerNodes (list< SWorkerNodeInfo > &worker_nodes) |
void | PrintConf (CNcbiOstream &output_stream) |
void | PrintServerStatistics (CNcbiOstream &output_stream, EStatisticsOptions opt=eStatisticsBrief) |
void | PrintHealth (CNcbiOstream &output_stream) |
void | DumpQueue (CNcbiOstream &output_stream, const string &start_after_job=kEmptyStr, size_t job_count=0, const string &job_statuses=kEmptyStr, const string &job_group=kEmptyStr) |
void | DumpQueue (CNcbiOstream &output_stream, const string &start_after_job, size_t job_count, CNetScheduleAPI::EJobStatus status, const string &job_group=kEmptyStr) |
void | GetQueueInfo (CNetServer server, const string &queue_name, TQueueInfo &queue_info) |
void | GetQueueInfo (const string &queue_name, TQueueInfo &queue_info) |
void | GetQueueInfo (CNetServer server, TQueueInfo &queue_info) |
void | GetQueueInfo (TQueueInfo &queue_info) |
void | PrintQueueInfo (const string &queue_name, CNcbiOstream &output_stream) |
void | GetQueueList (TQueueList &result) |
Definition at line 196 of file netschedule_api_int.hpp.
|
private |
Definition at line 303 of file netschedule_api_int.hpp.
|
private |
Definition at line 322 of file netschedule_api_int.hpp.
|
private |
Status map, shows number of jobs in each status.
Definition at line 201 of file netschedule_api_int.hpp.
|
private |
Shutdown level.
Definition at line 235 of file netschedule_api_int.hpp.
|
private |
Enumerator | |
---|---|
eStatisticsAll | |
eStatisticsBrief | |
eStatisticsClients |
Definition at line 279 of file netschedule_api_int.hpp.
Cancel all jobs in the queue (optionally with particular statuses).
job_statuses | Optional comma-separated list of job statuses |
Definition at line 127 of file netschedule_api_admin.cpp.
References cmd, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_CancelJob().
|
private |
Create an instance of the given queue class.
qname | Name of the queue to create |
qclass | Parameter set described in config file in a qclass_<qname> section. |
description | Brief free text description of the queue. |
Definition at line 81 of file netschedule_api_admin.cpp.
References cmd, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_CreateQueue(), and CGridCommandLineInterfaceApp::NetScheduleSanityCheck().
Delete queue Applicable only to queues, created through CreateQueue method.
qname | Name of the queue to delete. |
Definition at line 101 of file netschedule_api_admin.cpp.
References cmd, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_DeleteQueue(), and CGridCommandLineInterfaceApp::NetScheduleSanityCheck().
|
private |
Definition at line 110 of file netschedule_api_admin.cpp.
Referenced by CGridCommandLineInterfaceApp::Cmd_JobInfo(), g_ProcessJobInfo(), and CCgi2RCgiApp::GetStatusAndCtgTime().
|
private |
Definition at line 120 of file netschedule_api_admin.cpp.
References cmd, and g_AppendClientIPSessionIDHitID().
|
private |
Definition at line 180 of file netschedule_api_admin.cpp.
References CNetScheduleAPI::eJobNotFound, and CNetScheduleAPI::StatusToString().
|
private |
Definition at line 150 of file netschedule_api_admin.cpp.
References cmd, CNetService::eMultilineOutput, g_AppendClientIPSessionIDHitID(), and NStr::NumericToString().
Referenced by CGridCommandLineInterfaceApp::Cmd_DumpQueue().
|
private |
Definition at line 215 of file netschedule_api_admin.cpp.
References SNetServerImpl::ConnectAndExec(), CNetServer::SExecResult::response, s_MkQINFCmd(), and s_ParseQueueInfo().
Referenced by SSingleQueueInfoToJson::ExecOn(), CCgi2RCgiApp::GetStatus(), and SGridWorkerNodeImpl::Run().
|
private |
Definition at line 232 of file netschedule_api_admin.cpp.
|
private |
Definition at line 225 of file netschedule_api_admin.cpp.
|
private |
Definition at line 238 of file netschedule_api_admin.cpp.
|
private |
Definition at line 300 of file netschedule_api_admin.cpp.
References cmd, CNetService::eIncludePenalized, g_AppendClientIPSessionIDHitID(), CNetServerMultilineCmdOutput::ReadLine(), and NStr::StartsWith().
Referenced by CGridCommandLineInterfaceApp::Cmd_GetQueueList(), and CGridCommandLineInterfaceApp::NetScheduleSanityCheck().
|
private |
Definition at line 268 of file netschedule_api_admin.cpp.
References g_GetWorkerNodes().
|
private |
|
private |
Definition at line 274 of file netschedule_api_admin.cpp.
References cmd, CNetService::eMultilineOutput, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_GetConf().
|
private |
Definition at line 292 of file netschedule_api_admin.cpp.
References cmd, CNetService::eUrlEncodedOutput, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_Health().
|
private |
Definition at line 243 of file netschedule_api_admin.cpp.
References CNetService::eIncludePenalized, ITERATE, and NcbiEndl.
Referenced by CGridCommandLineInterfaceApp::Cmd_QueueInfo().
|
private |
Definition at line 282 of file netschedule_api_admin.cpp.
References cmd, CNetService::eMultilineOutput_NetCacheStyle, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_Stats(), and CGridCommandLineInterfaceApp::PrintNetScheduleStats().
|
private |
Print version string.
Definition at line 141 of file netschedule_api_admin.cpp.
References cmd, CNetService::eSingleLineOutput, and g_AppendClientIPSessionIDHitID().
|
private |
Definition at line 74 of file netschedule_api_admin.cpp.
References cmd, and g_AppendClientIPSessionIDHitID().
|
private |
Shutdown the server daemon.
Definition at line 52 of file netschedule_api_admin.cpp.
References cmd, CNetSrvConnException::eConnClosedByServer, SNetServiceImpl::SRetry::eDefault, eDie, eDrain, SNetServiceImpl::SRetry::eNoRetry, g_AppendClientIPSessionIDHitID(), and CException::GetErrCode().
Referenced by CGridCommandLineInterfaceApp::Cmd_Shutdown(), NAutomation::SNetScheduleService::ExecShutdown(), and NAutomation::SWorkerNode::ExecShutdown().
|
private |
Returns statuses for a given affinity token.
status_map | Status map (status to job count) |
affinity_token | Affinity token (optional) |
job_group | Only jobs belonging to the specified group (optional) |
Definition at line 323 of file netschedule_api_admin.cpp.
References cmd, CNetService::eIncludePenalized, NStr::eTrunc_Begin, g_AppendClientIPSessionIDHitID(), NCBI_RETHROW, CNetServerMultilineCmdOutput::ReadLine(), NStr::SplitInTwo(), NStr::StringToUInt(), and NStr::TruncateSpaces_Unsafe().
Referenced by NAutomation::SNetScheduleService::ExecJobCounters(), and CGridCommandLineInterfaceApp::PrintNetScheduleStats().
|
private |
Enable server drain mode.
Definition at line 44 of file netschedule_api_admin.cpp.
References cmd, eOff, and g_AppendClientIPSessionIDHitID().
Referenced by CGridCommandLineInterfaceApp::Cmd_Drain().