NCBI C++ ToolKit
Classes | Private Types | Private Member Functions | List of all members
CNetScheduleAdmin Class Reference

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, stringTQueueInfo
 
typedef list< SServerQueueListTQueueList
 

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)
 

Detailed Description

Definition at line 196 of file netschedule_api_int.hpp.

Member Typedef Documentation

◆ TQueueInfo

Definition at line 303 of file netschedule_api_int.hpp.

◆ TQueueList

Definition at line 322 of file netschedule_api_int.hpp.

◆ TStatusMap

typedef map<string, unsigned> CNetScheduleAdmin::TStatusMap
private

Status map, shows number of jobs in each status.

Definition at line 201 of file netschedule_api_int.hpp.

Member Enumeration Documentation

◆ EShutdownLevel

Shutdown level.

Enumerator
eNoShutdown 

No Shutdown was requested.

eNormalShutdown 

Normal shutdown was requested.

eShutdownImmediate 

Urgent shutdown was requested.

eDie 

A serious error occurred, the server shuts down.

eDrain 

Wait for all server data to expire.

Definition at line 235 of file netschedule_api_int.hpp.

◆ EStatisticsOptions

Enumerator
eStatisticsAll 
eStatisticsBrief 
eStatisticsClients 

Definition at line 279 of file netschedule_api_int.hpp.

Member Function Documentation

◆ CancelAllJobs()

void CNetScheduleAdmin::CancelAllJobs ( const string job_statuses = kEmptyStr)
private

Cancel all jobs in the queue (optionally with particular statuses).

Parameters
job_statusesOptional 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().

◆ CreateQueue()

void CNetScheduleAdmin::CreateQueue ( const string qname,
const string qclass,
const string description = kEmptyStr 
)
private

Create an instance of the given queue class.

Parameters
qnameName of the queue to create
qclassParameter set described in config file in a qclass_<qname> section.
descriptionBrief 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().

◆ DeleteQueue()

void CNetScheduleAdmin::DeleteQueue ( const string qname)
private

Delete queue Applicable only to queues, created through CreateQueue method.

Parameters
qnameName 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().

◆ DumpJob() [1/2]

void CNetScheduleAdmin::DumpJob ( CNcbiOstream out,
const string job_key 
)
private

◆ DumpJob() [2/2]

CNetServerMultilineCmdOutput CNetScheduleAdmin::DumpJob ( const string job_key)
private

Definition at line 120 of file netschedule_api_admin.cpp.

References cmd, and g_AppendClientIPSessionIDHitID().

◆ DumpQueue() [1/2]

void CNetScheduleAdmin::DumpQueue ( CNcbiOstream output_stream,
const string start_after_job,
size_t  job_count,
CNetScheduleAPI::EJobStatus  status,
const string job_group = kEmptyStr 
)
private

◆ DumpQueue() [2/2]

void CNetScheduleAdmin::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 
)
private

◆ GetQueueInfo() [1/4]

void CNetScheduleAdmin::GetQueueInfo ( CNetServer  server,
const string queue_name,
CNetScheduleAdmin::TQueueInfo queue_info 
)
private

◆ GetQueueInfo() [2/4]

void CNetScheduleAdmin::GetQueueInfo ( CNetServer  server,
CNetScheduleAdmin::TQueueInfo queue_info 
)
private

Definition at line 232 of file netschedule_api_admin.cpp.

◆ GetQueueInfo() [3/4]

void CNetScheduleAdmin::GetQueueInfo ( const string queue_name,
CNetScheduleAdmin::TQueueInfo queue_info 
)
private

Definition at line 225 of file netschedule_api_admin.cpp.

◆ GetQueueInfo() [4/4]

void CNetScheduleAdmin::GetQueueInfo ( CNetScheduleAdmin::TQueueInfo queue_info)
private

Definition at line 238 of file netschedule_api_admin.cpp.

◆ GetQueueList()

void CNetScheduleAdmin::GetQueueList ( TQueueList result)
private

◆ GetWorkerNodes()

void CNetScheduleAdmin::GetWorkerNodes ( list< SWorkerNodeInfo > &  worker_nodes)
private

Definition at line 268 of file netschedule_api_admin.cpp.

References g_GetWorkerNodes().

◆ NCBI_NET_COMPONENT()

CNetScheduleAdmin::NCBI_NET_COMPONENT ( NetScheduleAdmin  )
private

◆ PrintConf()

void CNetScheduleAdmin::PrintConf ( CNcbiOstream output_stream)
private

◆ PrintHealth()

void CNetScheduleAdmin::PrintHealth ( CNcbiOstream output_stream)
private

◆ PrintQueueInfo()

void CNetScheduleAdmin::PrintQueueInfo ( const string queue_name,
CNcbiOstream output_stream 
)
private

◆ PrintServerStatistics()

void CNetScheduleAdmin::PrintServerStatistics ( CNcbiOstream output_stream,
EStatisticsOptions  opt = eStatisticsBrief 
)
private

◆ PrintServerVersion()

void CNetScheduleAdmin::PrintServerVersion ( CNcbiOstream output_stream)
private

Print version string.

Definition at line 141 of file netschedule_api_admin.cpp.

References cmd, CNetService::eSingleLineOutput, and g_AppendClientIPSessionIDHitID().

◆ ReloadServerConfig()

void CNetScheduleAdmin::ReloadServerConfig ( )
private

Definition at line 74 of file netschedule_api_admin.cpp.

References cmd, and g_AppendClientIPSessionIDHitID().

◆ ShutdownServer()

void CNetScheduleAdmin::ShutdownServer ( CNetScheduleAdmin::EShutdownLevel  level = eNormalShutdown)
private

◆ StatusSnapshot()

void CNetScheduleAdmin::StatusSnapshot ( CNetScheduleAdmin::TStatusMap status_map,
const string affinity_token = kEmptyStr,
const string job_group = kEmptyStr 
)
private

Returns statuses for a given affinity token.

Parameters
status_mapStatus map (status to job count)
affinity_tokenAffinity token (optional)
job_groupOnly 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().

◆ SwitchToDrainMode()

void CNetScheduleAdmin::SwitchToDrainMode ( ESwitch  on_off)
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().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:10 2024 by modify_doxy.py rev. 669887