NCBI C++ ToolKit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CNetScheduleServer Class Reference

Search Toolkit Book for CNetScheduleServer

NetScheduler threaded server. More...

#include "ns_server.hpp"
(Private to src/app/netschedule.)

+ Inheritance diagram for CNetScheduleServer:
+ Collaboration diagram for CNetScheduleServer:

Public Member Functions

 CNetScheduleServer (const string &dbpath, bool diskless)
 NetScheduler threaded server implementation. More...
virtual ~CNetScheduleServer ()
const boolIsLog () const
const boolIsLogBatchEachJob () const
const boolIsLogNotificationThread () const
const boolIsLogCleaningThread () const
const boolIsLogExecutionWatcherThread () const
const boolIsLogStatisticsThread () const
const unsigned intGetStatInterval () const
const unsigned intGetJobCountersInterval () const
bool GetRefuseSubmits () const
void SetRefuseSubmits (bool val)
unsigned GetInactivityTimeout (void) const
stringGetHost ()
unsigned GetPort () const
unsigned GetDeleteBatchSize (void) const
bool GetUseHostname (void) const
bool GetDiskless (void) const
unsigned GetMarkdelBatchSize (void) const
unsigned GetScanBatchSize (void) const
double GetPurgeTimeout (void) const
unsigned GetHostNetAddr () const
const CTimeGetStartTime (void) const
CBackgroundHostGetBackgroundHost ()
unsigned int GetMaxClientData (void) const
string GetNodeID (void) const
string GetSessionID (void) const
SNSRegistryParameters GetAffRegistrySettings (void) const
SNSRegistryParameters GetGroupRegistrySettings (void) const
SNSRegistryParameters GetScopeRegistrySettings (void) const
bool IsDrainShutdown (void) const
bool WasDBDrained (void) const
void SetDrainShutdown (void)
unsigned int GetCurrentSubmitsCounter (void)
unsigned int IncrementCurrentSubmitsCounter (void)
unsigned int DecrementCurrentSubmitsCounter (void)
const CNetScheduleAccessListGetAdminHosts (void) const
CCompoundIDPool GetCompoundIDPool (void) const
void SetJobsStartID (const string &qname, unsigned int value)
unsigned int GetJobsStartID (const string &qname)
void LoadJobsStartIDs (void)
void SerializeJobsStartIDs (void)
void AddDefaultListener (IServer_ConnectionFactory *factory)
CJsonNode SetNSParameters (const SNS_Parameters &new_params, bool limited)
CJsonNode ReadServicesConfig (const CNcbiRegistry &reg)
virtual bool ShutdownRequested (void)
 Runs synchronously between iterations. More...
void SetShutdownFlag (int signum=0, bool db_was_drained=false)
void SetQueueDB (CQueueDataBase *qdb)
unsigned int Configure (const IRegistry &reg, CJsonNode &diff)
unsigned CountActiveJobs () const
CRef< CQueueOpenQueue (const string &name)
void CreateDynamicQueue (const CNSClientId &client, const string &qname, const string &qclass, const string &description)
void DeleteDynamicQueue (const CNSClientId &client, const string &qname)
SQueueParameters QueueInfo (const string &qname) const
string GetQueueNames (const string &sep) const
string PrintTransitionCounters (void)
string PrintJobsStat (const CNSClientId &client)
string GetQueueClassesInfo (void) const
string GetQueueClassesConfig (void) const
string GetQueueInfo (void) const
string GetQueueConfig (void) const
string GetLinkedSectionConfig (void) const
string GetServiceToQueueSectionConfig (void) const
string ResolveService (const string &service) const
void GetServices (map< string, string > &services) const
bool AdminHostValid (unsigned host) const
bool IsAdminClientName (const string &name) const
bool ShouldPerfLogTransitions (const string &queue_name, const string &class_name) const
void InitNodeID (const string &db_path)
string GetAdminClientNames (void) const
string GetStateTransitionPerfLogQueues (void) const
string GetStateTransitionPerfLogClasses (void) const
string GetAlerts (void) const
string SerializeAlerts (void) const
enum EAlertAckResult AcknowledgeAlert (const string &id, const string &user)
enum EAlertAckResult AcknowledgeAlert (EAlertType alert_type, const string &user)
void RegisterAlert (EAlertType alert_type, const string &message)
void SetRAMConfigFileChecksum (const string &checksum)
string GetRAMConfigFileChecksum (void) const
void SetDiskConfigFileChecksum (const string &checksum)
string GetDiskConfigFileChecksum (void) const
void SetAnybodyCanReconfigure (bool val)
bool AnybodyCanReconfigure (void) const
unsigned int GetReserveDumpSpace (void) const
map< string, intGetPauseQueues (void) const
vector< stringGetRefuseSubmitQueues (void) const
string GetDataPath (void) const
SErrorEmulatorParameter GetDebugFDCount (void) const
SErrorEmulatorParameter GetDebugMemCount (void) const
SErrorEmulatorParameter GetDebugWriteDelay (void) const
SErrorEmulatorParameter GetDebugConnDropBeforeWrite (void) const
SErrorEmulatorParameter GetDebugConnDropAfterWrite (void) const
SErrorEmulatorParameter GetDebugReplyWithGarbage (void) const
string GetDebugGarbage (void) const
- Public Member Functions inherited from CServer
 CServer (void)
virtual ~CServer ()
void AddListener (IServer_ConnectionFactory *factory, unsigned short port)
 Register a listener. More...
bool RemoveListener (unsigned short port)
 Removes a listener. More...
void SetParameters (const SServer_Parameters &new_params)
void GetParameters (SServer_Parameters *params)
void StartListening (void)
 Start listening before the main loop. More...
void Run (void)
 Enter the main loop. More...
void SubmitRequest (const CRef< CStdRequest > &request)
 Submit request to be executed by the server thread pool. More...
void DeferConnectionProcessing (IServer_ConnectionBase *conn)
 Mark connection as deferred for processing, i.e. More...
void DeferConnectionProcessing (CSocket *sock)
void CloseConnection (CSocket *sock)
 Close connection. More...
void AddConnectionToPool (CServer_Connection *conn)
 Add externally created connection to the connection pool which server polls on. More...
void RemoveConnectionFromPool (CServer_Connection *conn)
 Remove externally created connection from pool. More...
void WakeUpPollCycle (void)
 Force poll cycle to make another iteration. More...
void SetCustomThreadSuffix (const string &suffix)
 Set custom suffix to use on all threads in the server's pool. More...
vector< unsigned short > GetListenerPorts (void)
 Provides a list of ports on which the server is listening. More...

Static Public Member Functions

static CNetScheduleServerGetInstance (void)

Protected Member Functions

virtual void Exit ()
 Cleanup the server. More...
- Protected Member Functions inherited from CServer
virtual void Init ()
 Initialize the server. More...
virtual void ProcessTimeout (void)
 Runs synchronously when no socket activity has occurred in a while (as determined by m_AcceptTimeout). More...
- Protected Member Functions inherited from CConnIniter
 CConnIniter (void)

Private Member Functions

string x_GenerateGUID (void) const
CJsonNode x_SetAdminClientNames (const string &client_names)
CJsonNode x_SetFromList (const string &from, vector< string > &to, CRWLock &lock)

Private Attributes

CNetScheduleBackgroundHost m_BackgroundHost
string m_Host
unsigned m_Port
unsigned m_HostNetAddr
bool m_Shutdown
int m_SigNum
unsigned int m_InactivityTimeout
CTime m_StartTime
bool m_LogFlag
bool m_LogBatchEachJobFlag
bool m_LogNotificationThreadFlag
bool m_LogCleaningThreadFlag
bool m_LogExecutionWatcherThreadFlag
bool m_LogStatisticsThreadFlag
bool m_RefuseSubmits
bool m_UseHostname
bool m_Diskless
CAtomicCounter m_CurrentSubmitsCounter
bool m_DBDrained
unsigned int m_DeleteBatchSize
unsigned int m_MarkdelBatchSize
unsigned int m_ScanBatchSize
double m_PurgeTimeout
unsigned int m_StatInterval
unsigned int m_JobCountersInterval
unsigned int m_MaxClientData
string m_NodeID
string m_SessionID
SNSRegistryParameters m_AffRegistrySettings
SNSRegistryParameters m_GroupRegistrySettings
SNSRegistryParameters m_ScopeRegistrySettings
CNetScheduleAccessList m_AdminHosts
CRWLock m_AdminClientsLock
vector< stringm_AdminClientNames
CRWLock m_STPerfLogQCLock
vector< stringm_StateTransitionPerfLogQueues
vector< stringm_StateTransitionPerfLogClasses
CNSAlerts m_Alerts
CFastMutex m_ServicesLock
map< string, stringm_Services
CNSStartIDs m_StartIDs
CCompoundIDPool m_CompoundIDPool
string m_RAMConfigFileChecksum
string m_DiskConfigFileChecksum
bool m_AnybodyCanReconfigure
unsigned int m_ReserveDumpSpace
SErrorEmulatorParameter debug_fd_count
SErrorEmulatorParameter debug_mem_count
SErrorEmulatorParameter debug_write_delay
SErrorEmulatorParameter debug_conn_drop_before_write
SErrorEmulatorParameter debug_conn_drop_after_write
SErrorEmulatorParameter debug_reply_with_garbage
string debug_garbage

Static Private Attributes

static CNetScheduleServersm_netschedule_server = 0

Detailed Description

NetScheduler threaded server.

Definition at line 56 of file ns_server.hpp.

Constructor & Destructor Documentation

◆ CNetScheduleServer()

CNetScheduleServer::CNetScheduleServer ( const string dbpath,
bool  diskless 

NetScheduler threaded server implementation.

Definition at line 48 of file ns_server.cpp.

References kSubmitCounterInitialValue, m_CurrentSubmitsCounter, CAtomicCounter::Set(), and sm_netschedule_server.

◆ ~CNetScheduleServer()

CNetScheduleServer::~CNetScheduleServer ( )

Definition at line 86 of file ns_server.cpp.

References m_QueueDB.

Member Function Documentation

◆ AcknowledgeAlert() [1/2]

enum EAlertAckResult CNetScheduleServer::AcknowledgeAlert ( const string id,
const string user 

◆ AcknowledgeAlert() [2/2]

enum EAlertAckResult CNetScheduleServer::AcknowledgeAlert ( EAlertType  alert_type,
const string user 

Definition at line 621 of file ns_server.cpp.

◆ AddDefaultListener()

void CNetScheduleServer::AddDefaultListener ( IServer_ConnectionFactory factory)

Definition at line 92 of file ns_server.cpp.

References _ASSERT, CServer::AddListener(), and m_Port.

◆ AdminHostValid()

bool CNetScheduleServer::AdminHostValid ( unsigned  host) const

◆ AnybodyCanReconfigure()

bool CNetScheduleServer::AnybodyCanReconfigure ( void  ) const

Definition at line 206 of file ns_server.hpp.

References m_AnybodyCanReconfigure.

Referenced by CNetScheduleHandler::x_ProcessReloadConfig().

◆ Configure()

unsigned int CNetScheduleServer::Configure ( const IRegistry reg,
CJsonNode diff 

Definition at line 393 of file ns_server.cpp.

References CQueueDataBase::Configure(), and m_QueueDB.

Referenced by CNetScheduleHandler::x_ProcessReloadConfig().

◆ CountActiveJobs()

unsigned CNetScheduleServer::CountActiveJobs ( void  ) const

◆ CreateDynamicQueue()

void CNetScheduleServer::CreateDynamicQueue ( const CNSClientId client,
const string qname,
const string qclass,
const string description 

◆ DecrementCurrentSubmitsCounter()

unsigned int CNetScheduleServer::DecrementCurrentSubmitsCounter ( void  )

◆ DeleteDynamicQueue()

void CNetScheduleServer::DeleteDynamicQueue ( const CNSClientId client,
const string qname 

◆ Exit()

void CNetScheduleServer::Exit ( void  )

Cleanup the server.

Called by Run method after poll cycle when all processing threads are stopped, but before releasing listening ports. Here you're still guaranteed that another instance running on the same set of ports will fail at StartListening point.

Reimplemented from CServer.

Definition at line 696 of file ns_server.cpp.

References CQueueDataBase::Close(), ctx, CDiagContext_Extra::Flush(), GetDiagContext(), IsLog(), m_QueueDB, m_SigNum, NULL, CDiagContext_Extra::Print(), CDiagContext::PrintRequestStart(), CDiagContext::PrintRequestStop(), and CDiagContext::SetRequestContext().

◆ GetAdminClientNames()

string CNetScheduleServer::GetAdminClientNames ( void  ) const

Definition at line 539 of file ns_server.cpp.

References m_AdminClientNames, and m_AdminClientsLock.

Referenced by CNetScheduleHandler::x_GetServerSection().

◆ GetAdminHosts()

const CNetScheduleAccessList& CNetScheduleServer::GetAdminHosts ( void  ) const

Definition at line 131 of file ns_server.hpp.

References m_AdminHosts.

Referenced by CNetScheduleHandler::x_GetServerSection().

◆ GetAffRegistrySettings()

SNSRegistryParameters CNetScheduleServer::GetAffRegistrySettings ( void  ) const

◆ GetAlerts()

string CNetScheduleServer::GetAlerts ( void  ) const

Definition at line 615 of file ns_server.cpp.

References CNSAlerts::GetURLEncoded(), and m_Alerts.

Referenced by CNetScheduleHandler::x_ProcessHealth().

◆ GetBackgroundHost()

CBackgroundHost& CNetScheduleServer::GetBackgroundHost ( )

Definition at line 104 of file ns_server.hpp.

References m_BackgroundHost.

◆ GetCompoundIDPool()

CCompoundIDPool CNetScheduleServer::GetCompoundIDPool ( void  ) const

◆ GetCurrentSubmitsCounter()

unsigned int CNetScheduleServer::GetCurrentSubmitsCounter ( void  )

Definition at line 125 of file ns_server.hpp.

References CAtomicCounter::Get(), and m_CurrentSubmitsCounter.

Referenced by CServiceThread::x_CheckDrainShutdown().

◆ GetDataPath()

string CNetScheduleServer::GetDataPath ( void  ) const

Definition at line 799 of file ns_server.cpp.

References CQueueDataBase::GetDataPath(), and m_QueueDB.

Referenced by SerializePauseState(), and SerializeRefuseSubmitState().

◆ GetDebugConnDropAfterWrite()

SErrorEmulatorParameter CNetScheduleServer::GetDebugConnDropAfterWrite ( void  ) const

Definition at line 319 of file ns_server.hpp.

References debug_conn_drop_after_write.

Referenced by CNetScheduleHandler::x_WriteMessage().

◆ GetDebugConnDropBeforeWrite()

SErrorEmulatorParameter CNetScheduleServer::GetDebugConnDropBeforeWrite ( void  ) const

Definition at line 317 of file ns_server.hpp.

References debug_conn_drop_before_write.

Referenced by CNetScheduleHandler::x_PrepareWriteBuffer().

◆ GetDebugFDCount()

SErrorEmulatorParameter CNetScheduleServer::GetDebugFDCount ( void  ) const

Definition at line 311 of file ns_server.hpp.

References debug_fd_count.

Referenced by CNetScheduleHandler::x_ProcessHealth().

◆ GetDebugGarbage()

string CNetScheduleServer::GetDebugGarbage ( void  ) const

Definition at line 323 of file ns_server.hpp.

References debug_garbage.

Referenced by CNetScheduleHandler::x_PrepareWriteBuffer().

◆ GetDebugMemCount()

SErrorEmulatorParameter CNetScheduleServer::GetDebugMemCount ( void  ) const

Definition at line 313 of file ns_server.hpp.

References debug_mem_count.

Referenced by CNetScheduleHandler::x_ProcessHealth().

◆ GetDebugReplyWithGarbage()

SErrorEmulatorParameter CNetScheduleServer::GetDebugReplyWithGarbage ( void  ) const

Definition at line 321 of file ns_server.hpp.

References debug_reply_with_garbage.

Referenced by CNetScheduleHandler::x_PrepareWriteBuffer().

◆ GetDebugWriteDelay()

SErrorEmulatorParameter CNetScheduleServer::GetDebugWriteDelay ( void  ) const

Definition at line 315 of file ns_server.hpp.

References debug_write_delay.

Referenced by CNetScheduleHandler::x_PrepareWriteBuffer().

◆ GetDeleteBatchSize()

unsigned CNetScheduleServer::GetDeleteBatchSize ( void  ) const

◆ GetDiskConfigFileChecksum()

string CNetScheduleServer::GetDiskConfigFileChecksum ( void  ) const

Definition at line 202 of file ns_server.hpp.

References m_DiskConfigFileChecksum.

Referenced by CServiceThread::x_CheckConfigFile().

◆ GetDiskless()

bool CNetScheduleServer::GetDiskless ( void  ) const

Definition at line 92 of file ns_server.hpp.

References m_Diskless.

Referenced by SerializePauseState(), and SerializeRefuseSubmitState().

◆ GetGroupRegistrySettings()

SNSRegistryParameters CNetScheduleServer::GetGroupRegistrySettings ( void  ) const

◆ GetHost()

string& CNetScheduleServer::GetHost ( void  )

Definition at line 84 of file ns_server.hpp.

References m_Host.

Referenced by CNetScheduleHandler::x_ProcessMsgBatchSubmit().

◆ GetHostNetAddr()

unsigned CNetScheduleServer::GetHostNetAddr ( ) const

Definition at line 100 of file ns_server.hpp.

References m_HostNetAddr.

Referenced by CNetScheduleHandler::x_GetPeerAddress().

◆ GetInactivityTimeout()

unsigned CNetScheduleServer::GetInactivityTimeout ( void  ) const

◆ GetInstance()

CNetScheduleServer * CNetScheduleServer::GetInstance ( void  )

Definition at line 690 of file ns_server.cpp.

References sm_netschedule_server.

Referenced by SJobDump::Read(), and Threaded_Server_SignalHandler().

◆ GetJobCountersInterval()

const unsigned int& CNetScheduleServer::GetJobCountersInterval ( ) const

◆ GetJobsStartID()

unsigned int CNetScheduleServer::GetJobsStartID ( const string qname)

Definition at line 137 of file ns_server.hpp.

References CNSStartIDs::Get(), and m_StartIDs.

Referenced by CQueue::Attach().

◆ GetLinkedSectionConfig()

string CNetScheduleServer::GetLinkedSectionConfig ( void  ) const

◆ GetMarkdelBatchSize()

unsigned CNetScheduleServer::GetMarkdelBatchSize ( void  ) const

Definition at line 94 of file ns_server.hpp.

References m_MarkdelBatchSize.

Referenced by CQueueDataBase::Purge(), and CNetScheduleHandler::x_GetServerSection().

◆ GetMaxClientData()

unsigned int CNetScheduleServer::GetMaxClientData ( void  ) const

◆ GetNodeID()

string CNetScheduleServer::GetNodeID ( void  ) const

◆ GetPauseQueues()

map< string, int > CNetScheduleServer::GetPauseQueues ( void  ) const

Definition at line 787 of file ns_server.cpp.

References CQueueDataBase::GetPauseQueues(), and m_QueueDB.

Referenced by SerializePauseState().

◆ GetPort()

unsigned CNetScheduleServer::GetPort ( void  ) const

◆ GetPurgeTimeout()

double CNetScheduleServer::GetPurgeTimeout ( void  ) const

◆ GetQueueClassesConfig()

string CNetScheduleServer::GetQueueClassesConfig ( void  ) const

◆ GetQueueClassesInfo()

string CNetScheduleServer::GetQueueClassesInfo ( void  ) const

◆ GetQueueConfig()

string CNetScheduleServer::GetQueueConfig ( void  ) const

Definition at line 470 of file ns_server.cpp.

References CQueueDataBase::GetQueueConfig(), and m_QueueDB.

Referenced by CNetScheduleHandler::x_ProcessGetConf().

◆ GetQueueInfo()

string CNetScheduleServer::GetQueueInfo ( void  ) const

Definition at line 464 of file ns_server.cpp.

References CQueueDataBase::GetQueueInfo(), and m_QueueDB.

Referenced by CNetScheduleHandler::x_ProcessStatistics().

◆ GetQueueNames()

std::string CNetScheduleServer::GetQueueNames ( const string sep) const

Definition at line 434 of file ns_server.cpp.

References CQueueDataBase::GetQueueNames(), and m_QueueDB.

Referenced by CNetScheduleHandler::x_ProcessQList().

◆ GetRAMConfigFileChecksum()

string CNetScheduleServer::GetRAMConfigFileChecksum ( void  ) const

Definition at line 199 of file ns_server.hpp.

References m_RAMConfigFileChecksum.

Referenced by CServiceThread::x_CheckConfigFile().

◆ GetRefuseSubmitQueues()

vector< string > CNetScheduleServer::GetRefuseSubmitQueues ( void  ) const

Definition at line 793 of file ns_server.cpp.

References CQueueDataBase::GetRefuseSubmitQueues(), and m_QueueDB.

Referenced by SerializeRefuseSubmitState().

◆ GetRefuseSubmits()

bool CNetScheduleServer::GetRefuseSubmits ( ) const

◆ GetReserveDumpSpace()

unsigned int CNetScheduleServer::GetReserveDumpSpace ( void  ) const

◆ GetScanBatchSize()

unsigned CNetScheduleServer::GetScanBatchSize ( void  ) const

Definition at line 96 of file ns_server.hpp.

References m_ScanBatchSize.

Referenced by CQueueDataBase::Purge(), and CNetScheduleHandler::x_GetServerSection().

◆ GetScopeRegistrySettings()

SNSRegistryParameters CNetScheduleServer::GetScopeRegistrySettings ( void  ) const

◆ GetServices()

void CNetScheduleServer::GetServices ( map< string, string > &  services) const

Definition at line 515 of file ns_server.cpp.

References m_Services, and m_ServicesLock.

Referenced by CNetScheduleHandler::x_ProcessStatistics().

◆ GetServiceToQueueSectionConfig()

string CNetScheduleServer::GetServiceToQueueSectionConfig ( void  ) const

◆ GetSessionID()

string CNetScheduleServer::GetSessionID ( void  ) const

◆ GetStartTime()

const CTime& CNetScheduleServer::GetStartTime ( void  ) const

◆ GetStateTransitionPerfLogClasses()

string CNetScheduleServer::GetStateTransitionPerfLogClasses ( void  ) const

◆ GetStateTransitionPerfLogQueues()

string CNetScheduleServer::GetStateTransitionPerfLogQueues ( void  ) const

◆ GetStatInterval()

const unsigned int& CNetScheduleServer::GetStatInterval ( ) const

◆ GetUseHostname()

bool CNetScheduleServer::GetUseHostname ( void  ) const

Definition at line 90 of file ns_server.hpp.

References m_UseHostname.

Referenced by CNetScheduleHandler::x_GetServerSection().

◆ IncrementCurrentSubmitsCounter()

unsigned int CNetScheduleServer::IncrementCurrentSubmitsCounter ( void  )

◆ InitNodeID()

void CNetScheduleServer::InitNodeID ( const string db_path)

◆ IsAdminClientName()

bool CNetScheduleServer::IsAdminClientName ( const string name) const

◆ IsDrainShutdown()

bool CNetScheduleServer::IsDrainShutdown ( void  ) const

◆ IsLog()

const bool& CNetScheduleServer::IsLog ( void  ) const

◆ IsLogBatchEachJob()

const bool& CNetScheduleServer::IsLogBatchEachJob ( ) const

Definition at line 64 of file ns_server.hpp.

References m_LogBatchEachJobFlag.

Referenced by CNetScheduleHandler::x_GetServerSection().

◆ IsLogCleaningThread()

const bool& CNetScheduleServer::IsLogCleaningThread ( ) const

◆ IsLogExecutionWatcherThread()

const bool& CNetScheduleServer::IsLogExecutionWatcherThread ( ) const

◆ IsLogNotificationThread()

const bool& CNetScheduleServer::IsLogNotificationThread ( ) const

◆ IsLogStatisticsThread()

const bool& CNetScheduleServer::IsLogStatisticsThread ( ) const

◆ LoadJobsStartIDs()

void CNetScheduleServer::LoadJobsStartIDs ( void  )

Definition at line 139 of file ns_server.hpp.

References CNSStartIDs::Load(), and m_StartIDs.

Referenced by CQueueDataBase::CQueueDataBase().

◆ OpenQueue()

CRef< CQueue > CNetScheduleServer::OpenQueue ( const string name)

◆ PrintJobsStat()

string CNetScheduleServer::PrintJobsStat ( const CNSClientId client)

◆ PrintTransitionCounters()

string CNetScheduleServer::PrintTransitionCounters ( void  )

◆ QueueInfo()

SQueueParameters CNetScheduleServer::QueueInfo ( const string qname) const

Definition at line 428 of file ns_server.cpp.

References m_QueueDB, and CQueueDataBase::QueueInfo().

Referenced by CNetScheduleHandler::x_ProcessQueueInfo().

◆ ReadServicesConfig()

CJsonNode CNetScheduleServer::ReadServicesConfig ( const CNcbiRegistry reg)

◆ RegisterAlert()

void CNetScheduleServer::RegisterAlert ( EAlertType  alert_type,
const string message 

◆ ResolveService()

string CNetScheduleServer::ResolveService ( const string service) const

◆ SerializeAlerts()

string CNetScheduleServer::SerializeAlerts ( void  ) const

Definition at line 621 of file ns_server.cpp.

References m_Alerts, and CNSAlerts::Serialize().

Referenced by CNetScheduleHandler::x_ProcessStatistics().

◆ SerializeJobsStartIDs()

void CNetScheduleServer::SerializeJobsStartIDs ( void  )

Definition at line 141 of file ns_server.hpp.

References m_StartIDs, and CNSStartIDs::Serialize().

Referenced by CQueueDataBase::x_Open().

◆ SetAnybodyCanReconfigure()

void CNetScheduleServer::SetAnybodyCanReconfigure ( bool  val)

Definition at line 204 of file ns_server.hpp.

References m_AnybodyCanReconfigure, and val.

Referenced by CNetScheduleHandler::x_ProcessReloadConfig().

◆ SetDiskConfigFileChecksum()

void CNetScheduleServer::SetDiskConfigFileChecksum ( const string checksum)

◆ SetDrainShutdown()

void CNetScheduleServer::SetDrainShutdown ( void  )

◆ SetJobsStartID()

void CNetScheduleServer::SetJobsStartID ( const string qname,
unsigned int  value 

◆ SetNSParameters()

CJsonNode CNetScheduleServer::SetNSParameters ( const SNS_Parameters new_params,
bool  limited 

Definition at line 101 of file ns_server.cpp.

References SNS_Parameters::admin_client_names, SNS_Parameters::admin_hosts, SNS_Parameters::affinity_reg, CJsonNode::AppendBoolean(), CJsonNode::AppendInteger(), debug_conn_drop_after_write, SNS_Parameters::debug_conn_drop_after_write, debug_conn_drop_before_write, SNS_Parameters::debug_conn_drop_before_write, debug_fd_count, SNS_Parameters::debug_fd_count, debug_garbage, SNS_Parameters::debug_garbage, debug_mem_count, SNS_Parameters::debug_mem_count, debug_reply_with_garbage, SNS_Parameters::debug_reply_with_garbage, debug_write_delay, SNS_Parameters::debug_write_delay, SNS_Parameters::del_batch_size, CSocketAPI::gethostbyname(), CSocketAPI::gethostname(), CServer::GetParameters(), CJsonNode::GetSize(), SNS_Parameters::group_reg, SNS_Parameters::is_log, SNS_Parameters::job_counters_interval, kEmptyStr, SNS_Parameters::log_batch_each_job, SNS_Parameters::log_cleaning_thread, SNS_Parameters::log_execution_watcher_thread, SNS_Parameters::log_notification_thread, SNS_Parameters::log_statistics_thread, m_AdminClientNames, m_AdminClientsLock, m_AdminHosts, m_AffRegistrySettings, m_DeleteBatchSize, m_GroupRegistrySettings, m_Host, m_HostNetAddr, m_InactivityTimeout, m_JobCountersInterval, m_LogBatchEachJobFlag, m_LogCleaningThreadFlag, m_LogExecutionWatcherThreadFlag, m_LogFlag, m_LogNotificationThreadFlag, m_LogStatisticsThreadFlag, m_MarkdelBatchSize, m_MaxClientData, m_Port, m_PurgeTimeout, m_ReserveDumpSpace, m_ScanBatchSize, m_ScopeRegistrySettings, m_StateTransitionPerfLogClasses, m_StateTransitionPerfLogQueues, m_StatInterval, m_STPerfLogQCLock, m_UseHostname, SNS_Parameters::markdel_batch_size, SNS_Parameters::max_client_data, SServer_Parameters::max_connections, SNS_Parameters::network_timeout, CJsonNode::NewArrayNode(), CJsonNode::NewObjectNode(), CSocketAPI::ntoa(), SNS_Parameters::port, SNS_Parameters::purge_timeout, SNS_Parameters::reserve_dump_space, SNS_Parameters::scan_batch_size, SNS_Parameters::scope_reg, CJsonNode::SetByKey(), CNetScheduleAccessList::SetHosts(), CServer::SetParameters(), SNS_Parameters::stat_interval, SNS_Parameters::state_transition_perf_log_classes, SNS_Parameters::state_transition_perf_log_queues, SNS_Parameters::use_hostname, and x_SetFromList().

Referenced by CNetScheduleHandler::x_ProcessReloadConfig().

◆ SetQueueDB()

void CNetScheduleServer::SetQueueDB ( CQueueDataBase qdb)

Definition at line 375 of file ns_server.cpp.

References m_QueueDB.

◆ SetRAMConfigFileChecksum()

void CNetScheduleServer::SetRAMConfigFileChecksum ( const string checksum)

Definition at line 775 of file ns_server.cpp.

References m_RAMConfigFileChecksum.

Referenced by CNetScheduleHandler::x_ProcessReloadConfig().

◆ SetRefuseSubmits()

void CNetScheduleServer::SetRefuseSubmits ( bool  val)

◆ SetShutdownFlag()

void CNetScheduleServer::SetShutdownFlag ( int  signum = 0,
bool  db_was_drained = false 

◆ ShouldPerfLogTransitions()

bool CNetScheduleServer::ShouldPerfLogTransitions ( const string queue_name,
const string class_name 
) const

◆ ShutdownRequested()

bool CNetScheduleServer::ShutdownRequested ( void  )

Runs synchronously between iterations.

whether to shut down service and return from Run.

Reimplemented from CServer.

Definition at line 369 of file ns_server.cpp.

References m_Shutdown.

Referenced by CNetScheduleHandler::OnMessage(), Threaded_Server_SignalHandler(), CNetScheduleHandler::x_ProcessRefuseSubmits(), and CNetScheduleHandler::x_ProcessShutdown().

◆ WasDBDrained()

bool CNetScheduleServer::WasDBDrained ( void  ) const

Definition at line 120 of file ns_server.hpp.

References m_DBDrained.

Referenced by CQueueDataBase::Close().

◆ x_GenerateGUID()

string CNetScheduleServer::x_GenerateGUID ( void  ) const

Definition at line 732 of file ns_server.cpp.

References CCurrentProcess::GetPid().

Referenced by InitNodeID().

◆ x_SetAdminClientNames()

CJsonNode CNetScheduleServer::x_SetAdminClientNames ( const string client_names)

◆ x_SetFromList()

CJsonNode CNetScheduleServer::x_SetFromList ( const string from,
vector< string > &  to,
CRWLock lock 

Member Data Documentation

◆ debug_conn_drop_after_write

SErrorEmulatorParameter CNetScheduleServer::debug_conn_drop_after_write

Definition at line 306 of file ns_server.hpp.

Referenced by GetDebugConnDropAfterWrite(), and SetNSParameters().

◆ debug_conn_drop_before_write

SErrorEmulatorParameter CNetScheduleServer::debug_conn_drop_before_write

Definition at line 305 of file ns_server.hpp.

Referenced by GetDebugConnDropBeforeWrite(), and SetNSParameters().

◆ debug_fd_count

SErrorEmulatorParameter CNetScheduleServer::debug_fd_count

Definition at line 302 of file ns_server.hpp.

Referenced by GetDebugFDCount(), and SetNSParameters().

◆ debug_garbage

string CNetScheduleServer::debug_garbage

Definition at line 308 of file ns_server.hpp.

Referenced by GetDebugGarbage(), and SetNSParameters().

◆ debug_mem_count

SErrorEmulatorParameter CNetScheduleServer::debug_mem_count

Definition at line 303 of file ns_server.hpp.

Referenced by GetDebugMemCount(), and SetNSParameters().

◆ debug_reply_with_garbage

SErrorEmulatorParameter CNetScheduleServer::debug_reply_with_garbage

Definition at line 307 of file ns_server.hpp.

Referenced by GetDebugReplyWithGarbage(), and SetNSParameters().

◆ debug_write_delay

SErrorEmulatorParameter CNetScheduleServer::debug_write_delay

Definition at line 304 of file ns_server.hpp.

Referenced by GetDebugWriteDelay(), and SetNSParameters().

◆ m_AdminClientNames

vector<string> CNetScheduleServer::m_AdminClientNames

Definition at line 272 of file ns_server.hpp.

Referenced by GetAdminClientNames(), IsAdminClientName(), and SetNSParameters().

◆ m_AdminClientsLock

CRWLock CNetScheduleServer::m_AdminClientsLock

Definition at line 271 of file ns_server.hpp.

Referenced by GetAdminClientNames(), IsAdminClientName(), and SetNSParameters().

◆ m_AdminHosts

CNetScheduleAccessList CNetScheduleServer::m_AdminHosts

Definition at line 267 of file ns_server.hpp.

Referenced by AdminHostValid(), GetAdminHosts(), and SetNSParameters().

◆ m_AffRegistrySettings

SNSRegistryParameters CNetScheduleServer::m_AffRegistrySettings

Definition at line 262 of file ns_server.hpp.

Referenced by GetAffRegistrySettings(), and SetNSParameters().

◆ m_Alerts

CNSAlerts CNetScheduleServer::m_Alerts

Definition at line 278 of file ns_server.hpp.

Referenced by GetAlerts(), RegisterAlert(), and SerializeAlerts().

◆ m_AnybodyCanReconfigure

bool CNetScheduleServer::m_AnybodyCanReconfigure

Definition at line 290 of file ns_server.hpp.

Referenced by AnybodyCanReconfigure(), and SetAnybodyCanReconfigure().

◆ m_BackgroundHost

CNetScheduleBackgroundHost CNetScheduleServer::m_BackgroundHost

Definition at line 219 of file ns_server.hpp.

Referenced by GetBackgroundHost().

◆ m_CompoundIDPool

CCompoundIDPool CNetScheduleServer::m_CompoundIDPool

Definition at line 285 of file ns_server.hpp.

Referenced by GetCompoundIDPool().

◆ m_CurrentSubmitsCounter

CAtomicCounter CNetScheduleServer::m_CurrentSubmitsCounter

◆ m_DBDrained

bool CNetScheduleServer::m_DBDrained

Definition at line 246 of file ns_server.hpp.

Referenced by SetShutdownFlag(), and WasDBDrained().

◆ m_DeleteBatchSize

unsigned int CNetScheduleServer::m_DeleteBatchSize

Definition at line 250 of file ns_server.hpp.

Referenced by GetDeleteBatchSize(), and SetNSParameters().

◆ m_DiskConfigFileChecksum

string CNetScheduleServer::m_DiskConfigFileChecksum

Definition at line 288 of file ns_server.hpp.

Referenced by GetDiskConfigFileChecksum(), and SetDiskConfigFileChecksum().

◆ m_Diskless

bool CNetScheduleServer::m_Diskless

Definition at line 242 of file ns_server.hpp.

Referenced by GetDiskless(), and InitNodeID().

◆ m_GroupRegistrySettings

SNSRegistryParameters CNetScheduleServer::m_GroupRegistrySettings

Definition at line 263 of file ns_server.hpp.

Referenced by GetGroupRegistrySettings(), and SetNSParameters().

◆ m_Host

string CNetScheduleServer::m_Host

Definition at line 221 of file ns_server.hpp.

Referenced by GetHost(), and SetNSParameters().

◆ m_HostNetAddr

unsigned CNetScheduleServer::m_HostNetAddr

Definition at line 223 of file ns_server.hpp.

Referenced by GetHostNetAddr(), and SetNSParameters().

◆ m_InactivityTimeout

unsigned int CNetScheduleServer::m_InactivityTimeout

Definition at line 227 of file ns_server.hpp.

Referenced by GetInactivityTimeout(), and SetNSParameters().

◆ m_JobCountersInterval

unsigned int CNetScheduleServer::m_JobCountersInterval

Definition at line 255 of file ns_server.hpp.

Referenced by GetJobCountersInterval(), and SetNSParameters().

◆ m_LogBatchEachJobFlag

bool CNetScheduleServer::m_LogBatchEachJobFlag

Definition at line 233 of file ns_server.hpp.

Referenced by IsLogBatchEachJob(), and SetNSParameters().

◆ m_LogCleaningThreadFlag

bool CNetScheduleServer::m_LogCleaningThreadFlag

Definition at line 235 of file ns_server.hpp.

Referenced by IsLogCleaningThread(), and SetNSParameters().

◆ m_LogExecutionWatcherThreadFlag

bool CNetScheduleServer::m_LogExecutionWatcherThreadFlag

Definition at line 236 of file ns_server.hpp.

Referenced by IsLogExecutionWatcherThread(), and SetNSParameters().

◆ m_LogFlag

bool CNetScheduleServer::m_LogFlag

Definition at line 232 of file ns_server.hpp.

Referenced by IsLog(), and SetNSParameters().

◆ m_LogNotificationThreadFlag

bool CNetScheduleServer::m_LogNotificationThreadFlag

Definition at line 234 of file ns_server.hpp.

Referenced by IsLogNotificationThread(), and SetNSParameters().

◆ m_LogStatisticsThreadFlag

bool CNetScheduleServer::m_LogStatisticsThreadFlag

Definition at line 237 of file ns_server.hpp.

Referenced by IsLogStatisticsThread(), and SetNSParameters().

◆ m_MarkdelBatchSize

unsigned int CNetScheduleServer::m_MarkdelBatchSize

Definition at line 251 of file ns_server.hpp.

Referenced by GetMarkdelBatchSize(), and SetNSParameters().

◆ m_MaxClientData

unsigned int CNetScheduleServer::m_MaxClientData

Definition at line 257 of file ns_server.hpp.

Referenced by GetMaxClientData(), and SetNSParameters().

◆ m_NodeID

string CNetScheduleServer::m_NodeID

Definition at line 259 of file ns_server.hpp.

Referenced by GetNodeID(), and InitNodeID().

◆ m_Port

unsigned CNetScheduleServer::m_Port

Definition at line 222 of file ns_server.hpp.

Referenced by AddDefaultListener(), GetPort(), and SetNSParameters().

◆ m_PurgeTimeout

double CNetScheduleServer::m_PurgeTimeout

Definition at line 253 of file ns_server.hpp.

Referenced by GetPurgeTimeout(), and SetNSParameters().

◆ m_QueueDB

CQueueDataBase* CNetScheduleServer::m_QueueDB

◆ m_RAMConfigFileChecksum

string CNetScheduleServer::m_RAMConfigFileChecksum

Definition at line 287 of file ns_server.hpp.

Referenced by GetRAMConfigFileChecksum(), and SetRAMConfigFileChecksum().

◆ m_RefuseSubmits

bool CNetScheduleServer::m_RefuseSubmits

Definition at line 239 of file ns_server.hpp.

Referenced by GetRefuseSubmits(), and SetRefuseSubmits().

◆ m_ReserveDumpSpace

unsigned int CNetScheduleServer::m_ReserveDumpSpace

Definition at line 292 of file ns_server.hpp.

Referenced by GetReserveDumpSpace(), and SetNSParameters().

◆ m_ScanBatchSize

unsigned int CNetScheduleServer::m_ScanBatchSize

Definition at line 252 of file ns_server.hpp.

Referenced by GetScanBatchSize(), and SetNSParameters().

◆ m_ScopeRegistrySettings

SNSRegistryParameters CNetScheduleServer::m_ScopeRegistrySettings

Definition at line 264 of file ns_server.hpp.

Referenced by GetScopeRegistrySettings(), and SetNSParameters().

◆ m_Services

map< string, string > CNetScheduleServer::m_Services

◆ m_ServicesLock

CFastMutex CNetScheduleServer::m_ServicesLock

◆ m_SessionID

string CNetScheduleServer::m_SessionID

Definition at line 260 of file ns_server.hpp.

Referenced by GetSessionID().

◆ m_Shutdown

bool CNetScheduleServer::m_Shutdown

Definition at line 224 of file ns_server.hpp.

Referenced by SetShutdownFlag(), and ShutdownRequested().

◆ m_SigNum

int CNetScheduleServer::m_SigNum

Definition at line 225 of file ns_server.hpp.

Referenced by Exit(), and SetShutdownFlag().

◆ m_StartIDs

CNSStartIDs CNetScheduleServer::m_StartIDs

◆ m_StartTime

CTime CNetScheduleServer::m_StartTime

Definition at line 229 of file ns_server.hpp.

Referenced by GetStartTime().

◆ m_StateTransitionPerfLogClasses

vector<string> CNetScheduleServer::m_StateTransitionPerfLogClasses

◆ m_StateTransitionPerfLogQueues

vector<string> CNetScheduleServer::m_StateTransitionPerfLogQueues

◆ m_StatInterval

unsigned int CNetScheduleServer::m_StatInterval

Definition at line 254 of file ns_server.hpp.

Referenced by GetStatInterval(), and SetNSParameters().

◆ m_STPerfLogQCLock

CRWLock CNetScheduleServer::m_STPerfLogQCLock

◆ m_UseHostname

bool CNetScheduleServer::m_UseHostname

Definition at line 240 of file ns_server.hpp.

Referenced by GetUseHostname(), and SetNSParameters().

◆ sm_netschedule_server

CNetScheduleServer * CNetScheduleServer::sm_netschedule_server = 0

Definition at line 269 of file ns_server.hpp.

Referenced by CNetScheduleServer(), and GetInstance().

The documentation for this class was generated from the following files:
Modified on Sun Apr 21 03:44:15 2024 by rev. 669887