NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CQueue Class Reference

Search Toolkit Book for CQueue

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

+ Inheritance diagram for CQueue:
+ Collaboration diagram for CQueue:

Classes

struct  x_SJobPick
 

Public Types

enum  EQueueKind { eKindStatic = 0 , eKindDynamic = 1 }
 
enum  EPauseStatus { eNoPause = 0 , ePauseWithPullback = 1 , ePauseWithoutPullback = 2 }
 
enum  EJobReturnOption { eWithBlacklist = 0 , eWithoutBlacklist = 1 , eRollback = 2 }
 
typedef int TQueueKind
 
typedef int TPauseStatus
 
typedef int TJobReturnOption
 
typedef list< pair< string, string > > TParameterList
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CQueue (const string &queue_name, TQueueKind queue_kind, CNetScheduleServer *server, CQueueDataBase &qdb)
 
 ~CQueue ()
 
void Attach (void)
 
TQueueKind GetQueueKind (void) const
 
void SetParameters (const SQueueParameters &params)
 
TParameterList GetParameters () const
 
CNSPreciseTime GetTimeout () const
 
CNSPreciseTime GetRunTimeout () const
 
CNSPreciseTime GetReadTimeout () const
 
CNSPreciseTime GetPendingTimeout () const
 
CNSPreciseTime GetMaxPendingWaitTimeout () const
 
unsigned GetFailedRetries () const
 
bool IsSubmitAllowed (unsigned host) const
 
bool IsWorkerAllowed (unsigned host) const
 
bool IsReaderAllowed (unsigned host) const
 
bool IsProgramAllowed (const string &program_name) const
 
void GetMaxIOSizesAndLinkedSections (unsigned int &max_input_size, unsigned int &max_output_size, map< string, map< string, string > > &linked_sections) const
 
void GetLinkedSections (map< string, map< string, string > > &linked_sections) const
 
bool GetRefuseSubmits (void) const
 
void SetRefuseSubmits (bool val)
 
size_t GetAffSlotsUsed (void) const
 
size_t GetGroupSlotsUsed (void) const
 
size_t GetScopeSlotsUsed (void) const
 
size_t GetClientsCount (void) const
 
size_t GetGroupsCount (void) const
 
size_t GetNotifCount (void) const
 
size_t GetGCBacklogCount (void) const
 
const stringGetQueueName () const
 
string DecorateJob (unsigned int job_id) const
 
unsigned int Submit (const CNSClientId &client, CJob &job, const string &aff_token, const string &group, bool logging, CNSRollbackInterface *&rollback_action)
 
unsigned SubmitBatch (const CNSClientId &client, vector< pair< CJob, string > > &batch, const string &group, bool logging, CNSRollbackInterface *&rollback_action)
 
TJobStatus PutResult (const CNSClientId &client, const CNSPreciseTime &curr, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, int ret_code, const string &output)
 
bool GetJobOrWait (const CNSClientId &client, unsigned short port, unsigned int timeout, const list< string > *aff_list, bool wnode_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, bool new_format, const list< string > *group_list, CJob *new_job, CNSRollbackInterface *&rollback_action, string &added_pref_aff)
 
void CancelWaitGet (const CNSClientId &client)
 
void CancelWaitRead (const CNSClientId &client)
 
list< stringChangeAffinity (const CNSClientId &client, const list< string > &aff_to_add, const list< string > &aff_to_del, ECommandGroup cmd_group)
 
void SetAffinity (const CNSClientId &client, const list< string > &aff, ECommandGroup cmd_group)
 
int SetClientData (const CNSClientId &client, const string &data, int data_version)
 
TJobStatus JobDelayExpiration (unsigned int job_id, CJob &job, const CNSPreciseTime &tm)
 
TJobStatus JobDelayReadExpiration (unsigned int job_id, CJob &job, const CNSPreciseTime &tm)
 
TJobStatus GetStatusAndLifetime (unsigned int job_id, string &client_ip, string &client_sid, string &client_phid, string &progress_msg, CNSPreciseTime *lifetime)
 
TJobStatus GetStatusAndLifetimeAndTouch (unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)
 
TJobStatus SetJobListener (unsigned int job_id, CJob &job, unsigned int address, unsigned short port, const CNSPreciseTime &timeout, bool need_stolen, bool need_progress_msg, size_t *last_event_index)
 
bool PutProgressMessage (unsigned int job_id, CJob &job, const string &msg)
 
TJobStatus ReturnJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, string &warning, TJobReturnOption how)
 
TJobStatus RescheduleJob (const CNSClientId &client, unsigned int job_id, const string &job_key, const string &auth_token, const string &aff_token, const string &group, bool &auth_token_ok, CJob &job)
 
TJobStatus RedoJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job)
 
TJobStatus ReadAndTouchJob (unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)
 
TJobStatus Cancel (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool is_ns_rollback=false)
 
unsigned int CancelAllJobs (const CNSClientId &client, bool logging)
 
unsigned int CancelSelectedJobs (const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &statuses, bool logging, vector< string > &warnings)
 
TJobStatus GetJobStatus (unsigned job_id) const
 
bool IsEmpty () const
 
unsigned int GetNextId ()
 
unsigned int GetNextJobIdForBatch (unsigned count)
 
bool GetJobForReadingOrWait (const CNSClientId &client, unsigned int port, unsigned int timeout, const list< string > *aff_list, bool reader_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const list< string > *group_list, bool affinity_may_change, bool group_may_change, CJob *job, bool *no_more_jobs, CNSRollbackInterface *&rollback_action, string &added_pref_aff)
 
TJobStatus ConfirmReadingJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token)
 
TJobStatus FailReadingJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, bool no_retries)
 
TJobStatus ReturnReadingJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, bool is_ns_rollback, bool blacklist, TJobStatus target_status)
 
TJobStatus RereadJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool &no_op)
 
void EraseJob (unsigned job_id, TJobStatus status)
 
void OptimizeMem ()
 
TJobStatus FailJob (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, const string &output, int ret_code, bool no_retries, string warning)
 
string GetAffinityTokenByID (unsigned int aff_id) const
 
void ClearWorkerNode (const CNSClientId &client, bool &client_was_found, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
 
void NotifyListenersPeriodically (const CNSPreciseTime &current_time)
 
CNSPreciseTime NotifyExactListeners (void)
 
string PrintClientsList (bool verbose) const
 
string PrintNotificationsList (bool verbose) const
 
string PrintAffinitiesList (const CNSClientId &client, bool verbose) const
 
string PrintGroupsList (const CNSClientId &client, bool verbose) const
 
string PrintScopesList (bool verbose) const
 
void CheckExecutionTimeout (bool logging)
 
SPurgeAttributes CheckJobsExpiry (const CNSPreciseTime &current_time, SPurgeAttributes attributes, unsigned int last_job, TJobStatus status)
 
void TimeLineMove (unsigned int job_id, const CNSPreciseTime &old_time, const CNSPreciseTime &new_time)
 
void TimeLineAdd (unsigned int job_id, const CNSPreciseTime &job_time)
 
void TimeLineRemove (unsigned int job_id)
 
void TimeLineExchange (unsigned int remove_job_id, unsigned int add_job_id, const CNSPreciseTime &new_time)
 
unsigned int DeleteBatch (unsigned int max_deleted)
 
unsigned int PurgeAffinities (void)
 
unsigned int PurgeGroups (void)
 
void StaleNodes (const CNSPreciseTime &current_time)
 
void PurgeBlacklistedJobs (void)
 
void PurgeClientRegistry (const CNSPreciseTime &current_time)
 
string PrintJobDbStat (const CNSClientId &client, unsigned int job_id, TDumpFields dump_fields)
 
string PrintAllJobDbStat (const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &job_statuses, unsigned int start_after_job_id, unsigned int count, bool order_first, TDumpFields dump_fields, bool logging)
 
unsigned CountStatus (TJobStatus) const
 
void StatusStatistics (TJobStatus status, TNSBitVector::statistics *st) const
 
string MakeJobKey (unsigned int job_id) const
 
void TouchClientsRegistry (CNSClientId &client, bool &client_was_found, bool &session_was_reset, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
 
void MarkClientAsAdmin (const CNSClientId &client)
 
void RegisterSocketWriteError (const CNSClientId &client)
 
void SetClientScope (const CNSClientId &client)
 
void PrintStatistics (size_t &aff_count) const
 
void PrintJobCounters (void) const
 
unsigned int GetJobsToDeleteCount (void) const
 
string PrintTransitionCounters (void) const
 
string PrintJobsStat (const CNSClientId &client, const string &group_token, const string &aff_token, vector< string > &warnings) const
 
void GetJobsPerState (const CNSClientId &client, const string &group_token, const string &aff_token, size_t *jobs, vector< string > &warnings) const
 
void CountTransition (CNetScheduleAPI::EJobStatus from, CNetScheduleAPI::EJobStatus to)
 
unsigned int CountActiveJobs (void) const
 
unsigned int CountAllJobs (void) const
 
bool AnyJobs (void) const
 
TPauseStatus GetPauseStatus (void) const
 
void SetPauseStatus (const CNSClientId &client, TPauseStatus status)
 
void RestorePauseStatus (TPauseStatus status)
 
void RegisterQueueResumeNotification (unsigned int address, unsigned short port, bool new_format)
 
void Dump (const string &dump_dir_name)
 
void RemoveDump (const string &dump_dir_name)
 
unsigned int LoadFromDump (const string &dump_dir_name)
 
bool ShouldPerfLogTransitions (void) const
 
void UpdatePerfLoggingSettings (const string &qclass)
 
- Public Member Functions inherited from CObjectEx
 CObjectEx (void)
 
virtual ~CObjectEx (void)
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (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...
 
- Public Member Functions inherited from CDebugDumpable
 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
 
- Public Member Functions inherited from CWeakObject
 CWeakObject (void)
 
virtual ~CWeakObject (void)
 
CPtrToObjectProxyGetPtrProxy (void) const
 Get pointer to proxy object containing pointer to this object. More...
 

Private Member Functions

TJobStatus x_ChangeReadingStatus (const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, TJobStatus target_status, bool is_ns_rollback, bool no_retries)
 
x_SJobPick x_FindVacantJob (const CNSClientId &client, const TNSBitVector &explicit_affs, const vector< unsigned int > &aff_ids, bool use_pref_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const TNSBitVector &group_ids, bool has_groups, ECommandGroup cmd_group)
 
x_SJobPick x_FindVacantJob (const CNSClientId &client, const TNSBitVector &explicit_affs, const vector< unsigned int > &aff_ids, bool use_pref_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const TNSBitVector &group_ids, bool has_groups, ECommandGroup cmd_group, const string &scope)
 
map< string, size_t > x_GetRunningJobsPerClientIP (void)
 
bool x_ValidateMaxJobsPerClientIP (unsigned int job_id, const map< string, size_t > &jobs_per_client_ip) const
 
x_SJobPick x_FindOutdatedPendingJob (const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids)
 
x_SJobPick x_FindOutdatedPendingJob (const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids, const string &scope)
 
x_SJobPick x_FindOutdatedJobForReading (const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids)
 
x_SJobPick x_FindOutdatedJobForReading (const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids, const string &scope)
 
void x_UpdateDB_PutResultNoLock (unsigned job_id, const string &auth_token, const CNSPreciseTime &curr, int ret_code, const string &output, CJob &job, const CNSClientId &client)
 
void x_UpdateDB_ProvideJobNoLock (const CNSClientId &client, const CNSPreciseTime &curr, unsigned int job_id, ECommandGroup cmd_group, CJob &job)
 
void x_CheckExecutionTimeout (const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, unsigned job_id, const CNSPreciseTime &curr_time, bool logging)
 
void x_LogSubmit (const CJob &job)
 
void x_ResetRunningDueToClear (const CNSClientId &client, const TNSBitVector &jobs)
 
void x_ResetReadingDueToClear (const CNSClientId &client, const TNSBitVector &jobs)
 
void x_ResetRunningDueToNewSession (const CNSClientId &client, const TNSBitVector &jobs)
 
void x_ResetReadingDueToNewSession (const CNSClientId &client, const TNSBitVector &jobs)
 
TJobStatus x_ResetDueTo (const CNSClientId &client, unsigned int job_id, const CNSPreciseTime &current_time, TJobStatus status_from, CJobEvent::EJobEvent event_type)
 
void x_RegisterGetListener (const CNSClientId &client, unsigned short port, unsigned int timeout, const TNSBitVector &aff_ids, bool wnode_aff, bool any_aff, bool exclusive_new_affinity, bool new_format, const TNSBitVector &group_ids)
 
void x_RegisterReadListener (const CNSClientId &client, unsigned short port, unsigned int timeout, const TNSBitVector &aff_ids, bool reader_aff, bool any_aff, bool exclusive_new_affinity, const TNSBitVector &group_ids)
 
bool x_UnregisterGetListener (const CNSClientId &client, unsigned short port)
 
void x_Erase (const TNSBitVector &job_ids, TJobStatus status)
 Erase jobs from all structures, request delayed db deletion. More...
 
string x_DumpJobs (const TNSBitVector &jobs_to_dump, unsigned int start_after_job_id, unsigned int count, TDumpFields dump_fields, bool order_first)
 
unsigned int x_CancelJobs (const CNSClientId &client, const TNSBitVector &jobs_to_cancel, bool logging)
 
CNSPreciseTime x_GetEstimatedJobLifetime (unsigned int job_id, TJobStatus status) const
 
bool x_NoMoreReadJobs (const CNSClientId &client, const TNSBitVector &aff_list, bool reader_affinity, bool any_affinity, bool exclusive_new_affinity, const TNSBitVector &group_list, bool affinity_may_change, bool group_may_change)
 
string x_GetJobsDumpFileName (const string &dump_dname) const
 
void x_ClearQueue (void)
 
void x_NotifyJobChanges (const CJob &job, const string &job_key, ENotificationReason reason, const CNSPreciseTime &current_time)
 

Private Attributes

CNetScheduleServerm_Server
 
CJobStatusTracker m_StatusTracker
 
CQueueDataBasem_QueueDB
 
map< unsigned int, CJobm_Jobs
 
CJobTimeLinem_RunTimeLine
 
CRWLock m_RunTimeLineLock
 
string m_QueueName
 
TQueueKind m_Kind
 
CFastMutex m_OperationLock
 
CNSClientsRegistry m_ClientsRegistry
 
CNSAffinityRegistry m_AffinityRegistry
 
unsigned int m_LastId
 
unsigned int m_SavedId
 
CFastMutex m_LastIdLock
 
CFastMutex m_JobsToDeleteLock
 
TNSBitVector m_JobsToDelete
 
unsigned int m_JobsToDeleteOps
 
TNSBitVector m_ReadJobs
 
unsigned int m_ReadJobsOps
 
CFastMutex m_ParamLock
 
CNSPreciseTime m_Timeout
 
CNSPreciseTime m_RunTimeout
 
CNSPreciseTime m_ReadTimeout
 
unsigned m_FailedRetries
 
unsigned m_ReadFailedRetries
 
unsigned m_MaxJobsPerClient
 
CNSPreciseTime m_BlacklistTime
 
CNSPreciseTime m_ReadBlacklistTime
 
unsigned m_MaxInputSize
 
unsigned m_MaxOutputSize
 
CNSPreciseTime m_WNodeTimeout
 
CNSPreciseTime m_ReaderTimeout
 
CNSPreciseTime m_PendingTimeout
 
CNSPreciseTime m_MaxPendingWaitTimeout
 
CNSPreciseTime m_MaxPendingReadWaitTimeout
 
CQueueClientInfoList m_ProgramVersionList
 
CNetScheduleAccessList m_SubmHosts
 
CNetScheduleAccessList m_WnodeHosts
 
CNetScheduleAccessList m_ReaderHosts
 
CNetScheduleKeyGenerator m_KeyGenerator
 
const boolm_Log
 
const boolm_LogBatchEachJob
 
bool m_RefuseSubmits
 
CStatisticsCounters m_StatisticsCounters
 
CStatisticsCounters m_StatisticsCountersLastPrinted
 
CNSPreciseTime m_StatisticsCountersLastPrintedTimestamp
 
CNSNotificationList m_NotificationsList
 
CNSPreciseTime m_NotifHifreqInterval
 
CNSPreciseTime m_NotifHifreqPeriod
 
unsigned int m_NotifLofreqMult
 
CNSPreciseTime m_HandicapTimeout
 
unsigned int m_DumpBufferSize
 
unsigned int m_DumpClientBufferSize
 
unsigned int m_DumpAffBufferSize
 
unsigned int m_DumpGroupBufferSize
 
bool m_ScrambleJobKeys
 
map< string, stringm_LinkedSections
 
CNSGroupsRegistry m_GroupRegistry
 
CJobGCRegistry m_GCRegistry
 
TPauseStatus m_PauseStatus
 
CNSPreciseTime m_ClientRegistryTimeoutWorkerNode
 
unsigned int m_ClientRegistryMinWorkerNodes
 
CNSPreciseTime m_ClientRegistryTimeoutAdmin
 
unsigned int m_ClientRegistryMinAdmins
 
CNSPreciseTime m_ClientRegistryTimeoutSubmitter
 
unsigned int m_ClientRegistryMinSubmitters
 
CNSPreciseTime m_ClientRegistryTimeoutReader
 
unsigned int m_ClientRegistryMinReaders
 
CNSPreciseTime m_ClientRegistryTimeoutUnknown
 
unsigned int m_ClientRegistryMinUnknowns
 
CNSScopeRegistry m_ScopeRegistry
 
bool m_ShouldPerfLogTransitions
 
vector< CNetScheduleAPI::EJobStatusm_StatesForRead
 

Friends

class CJob
 
class CQueueParamAccessor
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
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 Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
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...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Protected Member Functions inherited from CWeakObject
void CleanWeakRefs (void) const
 Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More...
 

Detailed Description

Definition at line 79 of file ns_queue.hpp.

Member Typedef Documentation

◆ TJobReturnOption

Definition at line 102 of file ns_queue.hpp.

◆ TParameterList

typedef list<pair<string, string> > CQueue::TParameterList

Definition at line 116 of file ns_queue.hpp.

◆ TPauseStatus

Definition at line 94 of file ns_queue.hpp.

◆ TQueueKind

Definition at line 86 of file ns_queue.hpp.

Member Enumeration Documentation

◆ EJobReturnOption

Enumerator
eWithBlacklist 
eWithoutBlacklist 
eRollback 

Definition at line 97 of file ns_queue.hpp.

◆ EPauseStatus

Enumerator
eNoPause 
ePauseWithPullback 
ePauseWithoutPullback 

Definition at line 89 of file ns_queue.hpp.

◆ EQueueKind

Enumerator
eKindStatic 
eKindDynamic 

Definition at line 82 of file ns_queue.hpp.

Constructor & Destructor Documentation

◆ CQueue()

CQueue::CQueue ( const string queue_name,
TQueueKind  queue_kind,
CNetScheduleServer server,
CQueueDataBase qdb 
)

◆ ~CQueue()

CQueue::~CQueue ( )

Definition at line 139 of file ns_queue.cpp.

References m_RunTimeLine.

Member Function Documentation

◆ AnyJobs()

bool CQueue::AnyJobs ( void  ) const
inline

Definition at line 452 of file ns_queue.hpp.

References CJobStatusTracker::AnyJobs(), and m_StatusTracker.

◆ Attach()

void CQueue::Attach ( void  )

◆ Cancel()

TJobStatus CQueue::Cancel ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
bool  is_ns_rollback = false 
)

◆ CancelAllJobs()

unsigned int CQueue::CancelAllJobs ( const CNSClientId client,
bool  logging 
)

◆ CancelSelectedJobs()

unsigned int CQueue::CancelSelectedJobs ( const CNSClientId client,
const string group,
const string aff_token,
const vector< TJobStatus > &  statuses,
bool  logging,
vector< string > &  warnings 
)

◆ CancelWaitGet()

void CQueue::CancelWaitGet ( const CNSClientId client)

◆ CancelWaitRead()

void CQueue::CancelWaitRead ( const CNSClientId client)

◆ ChangeAffinity()

list< string > CQueue::ChangeAffinity ( const CNSClientId client,
const list< string > &  aff_to_add,
const list< string > &  aff_to_del,
ECommandGroup  cmd_group 
)

◆ CheckExecutionTimeout()

void CQueue::CheckExecutionTimeout ( bool  logging)

◆ CheckJobsExpiry()

SPurgeAttributes CQueue::CheckJobsExpiry ( const CNSPreciseTime current_time,
SPurgeAttributes  attributes,
unsigned int  last_job,
TJobStatus  status 
)

◆ ClearWorkerNode()

void CQueue::ClearWorkerNode ( const CNSClientId client,
bool client_was_found,
string old_session,
bool had_wn_pref_affs,
bool had_reader_pref_affs 
)

◆ ConfirmReadingJob()

TJobStatus CQueue::ConfirmReadingJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token 
)

◆ CountActiveJobs()

unsigned int CQueue::CountActiveJobs ( void  ) const

◆ CountAllJobs()

unsigned int CQueue::CountAllJobs ( void  ) const
inline

Definition at line 450 of file ns_queue.hpp.

References CJobStatusTracker::Count(), and m_StatusTracker.

◆ CountStatus()

unsigned CQueue::CountStatus ( TJobStatus  st) const

◆ CountTransition()

void CQueue::CountTransition ( CNetScheduleAPI::EJobStatus  from,
CNetScheduleAPI::EJobStatus  to 
)
inline

Definition at line 446 of file ns_queue.hpp.

References CStatisticsCounters::CountTransition(), and m_StatisticsCounters.

◆ DecorateJob()

string CQueue::DecorateJob ( unsigned int  job_id) const
inline

◆ DeleteBatch()

unsigned int CQueue::DeleteBatch ( unsigned int  max_deleted)

◆ Dump()

void CQueue::Dump ( const string dump_dir_name)

◆ EraseJob()

void CQueue::EraseJob ( unsigned  job_id,
TJobStatus  status 
)

◆ FailJob()

TJobStatus CQueue::FailJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
const string err_msg,
const string output,
int  ret_code,
bool  no_retries,
string  warning 
)

◆ FailReadingJob()

TJobStatus CQueue::FailReadingJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
const string err_msg,
bool  no_retries 
)

◆ GetAffinityTokenByID()

string CQueue::GetAffinityTokenByID ( unsigned int  aff_id) const

◆ GetAffSlotsUsed()

size_t CQueue::GetAffSlotsUsed ( void  ) const
inline

Definition at line 138 of file ns_queue.hpp.

References m_AffinityRegistry, and CNSAffinityRegistry::size().

◆ GetClientsCount()

size_t CQueue::GetClientsCount ( void  ) const
inline

Definition at line 141 of file ns_queue.hpp.

References m_ClientsRegistry, and CNSClientsRegistry::size().

◆ GetFailedRetries()

unsigned CQueue::GetFailedRetries ( ) const
inline

Definition at line 780 of file ns_queue.hpp.

References m_FailedRetries.

◆ GetGCBacklogCount()

size_t CQueue::GetGCBacklogCount ( void  ) const
inline

Definition at line 144 of file ns_queue.hpp.

References bm::bvector< Alloc >::count(), m_JobsToDelete, and m_JobsToDeleteLock.

◆ GetGroupsCount()

size_t CQueue::GetGroupsCount ( void  ) const
inline

Definition at line 142 of file ns_queue.hpp.

References m_GroupRegistry, and CNSGroupsRegistry::size().

◆ GetGroupSlotsUsed()

size_t CQueue::GetGroupSlotsUsed ( void  ) const
inline

Definition at line 139 of file ns_queue.hpp.

References m_GroupRegistry, and CNSGroupsRegistry::size().

◆ GetJobForReadingOrWait()

bool CQueue::GetJobForReadingOrWait ( const CNSClientId client,
unsigned int  port,
unsigned int  timeout,
const list< string > *  aff_list,
bool  reader_affinity,
bool  any_affinity,
bool  exclusive_new_affinity,
bool  prioritized_aff,
const list< string > *  group_list,
bool  affinity_may_change,
bool  group_may_change,
CJob job,
bool no_more_jobs,
CNSRollbackInterface *&  rollback_action,
string added_pref_aff 
)

◆ GetJobOrWait()

bool CQueue::GetJobOrWait ( const CNSClientId client,
unsigned short  port,
unsigned int  timeout,
const list< string > *  aff_list,
bool  wnode_affinity,
bool  any_affinity,
bool  exclusive_new_affinity,
bool  prioritized_aff,
bool  new_format,
const list< string > *  group_list,
CJob new_job,
CNSRollbackInterface *&  rollback_action,
string added_pref_aff 
)

◆ GetJobsPerState()

void CQueue::GetJobsPerState ( const CNSClientId client,
const string group_token,
const string aff_token,
size_t *  jobs,
vector< string > &  warnings 
) const

◆ GetJobStatus()

TJobStatus CQueue::GetJobStatus ( unsigned  job_id) const

◆ GetJobsToDeleteCount()

unsigned int CQueue::GetJobsToDeleteCount ( void  ) const

Definition at line 4404 of file ns_queue.cpp.

References bm::bvector< Alloc >::count(), m_JobsToDelete, and m_JobsToDeleteLock.

Referenced by PrintTransitionCounters().

◆ GetLinkedSections()

void CQueue::GetLinkedSections ( map< string, map< string, string > > &  linked_sections) const

◆ GetMaxIOSizesAndLinkedSections()

void CQueue::GetMaxIOSizesAndLinkedSections ( unsigned int max_input_size,
unsigned int max_output_size,
map< string, map< string, string > > &  linked_sections 
) const

◆ GetMaxPendingWaitTimeout()

CNSPreciseTime CQueue::GetMaxPendingWaitTimeout ( ) const
inline

Definition at line 776 of file ns_queue.hpp.

References m_MaxPendingWaitTimeout.

◆ GetNextId()

unsigned int CQueue::GetNextId ( )

◆ GetNextJobIdForBatch()

unsigned int CQueue::GetNextJobIdForBatch ( unsigned  count)

◆ GetNotifCount()

size_t CQueue::GetNotifCount ( void  ) const
inline

Definition at line 143 of file ns_queue.hpp.

References m_NotificationsList, and CNSNotificationList::size().

◆ GetParameters()

CQueue::TParameterList CQueue::GetParameters ( void  ) const

◆ GetPauseStatus()

TPauseStatus CQueue::GetPauseStatus ( void  ) const
inline

◆ GetPendingTimeout()

CNSPreciseTime CQueue::GetPendingTimeout ( ) const
inline

Definition at line 772 of file ns_queue.hpp.

References m_PendingTimeout.

Referenced by CJob::Print().

◆ GetQueueKind()

TQueueKind CQueue::GetQueueKind ( void  ) const
inline

Definition at line 113 of file ns_queue.hpp.

References m_Kind.

◆ GetQueueName()

const string& CQueue::GetQueueName ( ) const
inline

Definition at line 150 of file ns_queue.hpp.

References m_QueueName.

Referenced by g_DoErasePerfLogging(), g_DoPerfLogging(), and PrintStatistics().

◆ GetReadTimeout()

CNSPreciseTime CQueue::GetReadTimeout ( ) const
inline

Definition at line 768 of file ns_queue.hpp.

References m_ReadTimeout.

Referenced by CheckExecutionTimeout(), JobDelayReadExpiration(), and CJob::Print().

◆ GetRefuseSubmits()

bool CQueue::GetRefuseSubmits ( void  ) const
inline

◆ GetRunTimeout()

CNSPreciseTime CQueue::GetRunTimeout ( ) const
inline

Definition at line 764 of file ns_queue.hpp.

References m_RunTimeout.

Referenced by CheckExecutionTimeout(), JobDelayExpiration(), and CJob::Print().

◆ GetScopeSlotsUsed()

size_t CQueue::GetScopeSlotsUsed ( void  ) const
inline

Definition at line 140 of file ns_queue.hpp.

References m_ScopeRegistry, and CNSScopeRegistry::size().

Referenced by CNetScheduleHandler::x_ProcessSetScope().

◆ GetStatusAndLifetime()

TJobStatus CQueue::GetStatusAndLifetime ( unsigned int  job_id,
string client_ip,
string client_sid,
string client_phid,
string progress_msg,
CNSPreciseTime lifetime 
)

◆ GetStatusAndLifetimeAndTouch()

TJobStatus CQueue::GetStatusAndLifetimeAndTouch ( unsigned int  job_id,
CJob job,
CNSPreciseTime lifetime 
)

◆ GetTimeout()

CNSPreciseTime CQueue::GetTimeout ( void  ) const
inline

Definition at line 760 of file ns_queue.hpp.

References m_Timeout.

Referenced by CJob::Print(), and x_GetEstimatedJobLifetime().

◆ IsEmpty()

bool CQueue::IsEmpty ( void  ) const

Definition at line 1952 of file ns_queue.cpp.

References CJobStatusTracker::AnyJobs(), m_OperationLock, and m_StatusTracker.

◆ IsProgramAllowed()

bool CQueue::IsProgramAllowed ( const string program_name) const
inline

◆ IsReaderAllowed()

bool CQueue::IsReaderAllowed ( unsigned  host) const
inline

◆ IsSubmitAllowed()

bool CQueue::IsSubmitAllowed ( unsigned  host) const
inline

◆ IsWorkerAllowed()

bool CQueue::IsWorkerAllowed ( unsigned  host) const
inline

◆ JobDelayExpiration()

TJobStatus CQueue::JobDelayExpiration ( unsigned int  job_id,
CJob job,
const CNSPreciseTime tm 
)

◆ JobDelayReadExpiration()

TJobStatus CQueue::JobDelayReadExpiration ( unsigned int  job_id,
CJob job,
const CNSPreciseTime tm 
)

◆ LoadFromDump()

unsigned int CQueue::LoadFromDump ( const string dump_dir_name)

◆ MakeJobKey()

string CQueue::MakeJobKey ( unsigned int  job_id) const

◆ MarkClientAsAdmin()

void CQueue::MarkClientAsAdmin ( const CNSClientId client)

◆ NotifyExactListeners()

CNSPreciseTime CQueue::NotifyExactListeners ( void  )

◆ NotifyListenersPeriodically()

void CQueue::NotifyListenersPeriodically ( const CNSPreciseTime current_time)

◆ OptimizeMem()

void CQueue::OptimizeMem ( )

Definition at line 2503 of file ns_queue.cpp.

References m_StatusTracker, and CJobStatusTracker::OptimizeMem().

◆ PrintAffinitiesList()

string CQueue::PrintAffinitiesList ( const CNSClientId client,
bool  verbose 
) const

◆ PrintAllJobDbStat()

string CQueue::PrintAllJobDbStat ( const CNSClientId client,
const string group,
const string aff_token,
const vector< TJobStatus > &  job_statuses,
unsigned int  start_after_job_id,
unsigned int  count,
bool  order_first,
TDumpFields  dump_fields,
bool  logging 
)

◆ PrintClientsList()

string CQueue::PrintClientsList ( bool  verbose) const

◆ PrintGroupsList()

string CQueue::PrintGroupsList ( const CNSClientId client,
bool  verbose 
) const

◆ PrintJobCounters()

void CQueue::PrintJobCounters ( void  ) const

◆ PrintJobDbStat()

string CQueue::PrintJobDbStat ( const CNSClientId client,
unsigned int  job_id,
TDumpFields  dump_fields 
)

◆ PrintJobsStat()

string CQueue::PrintJobsStat ( const CNSClientId client,
const string group_token,
const string aff_token,
vector< string > &  warnings 
) const

◆ PrintNotificationsList()

string CQueue::PrintNotificationsList ( bool  verbose) const

◆ PrintScopesList()

string CQueue::PrintScopesList ( bool  verbose) const

◆ PrintStatistics()

void CQueue::PrintStatistics ( size_t &  aff_count) const

◆ PrintTransitionCounters()

string CQueue::PrintTransitionCounters ( void  ) const

◆ PurgeAffinities()

unsigned int CQueue::PurgeAffinities ( void  )

◆ PurgeBlacklistedJobs()

void CQueue::PurgeBlacklistedJobs ( void  )

◆ PurgeClientRegistry()

void CQueue::PurgeClientRegistry ( const CNSPreciseTime current_time)

◆ PurgeGroups()

unsigned int CQueue::PurgeGroups ( void  )

◆ PutProgressMessage()

bool CQueue::PutProgressMessage ( unsigned int  job_id,
CJob job,
const string msg 
)

◆ PutResult()

TJobStatus CQueue::PutResult ( const CNSClientId client,
const CNSPreciseTime curr,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
int  ret_code,
const string output 
)

◆ ReadAndTouchJob()

TJobStatus CQueue::ReadAndTouchJob ( unsigned int  job_id,
CJob job,
CNSPreciseTime lifetime 
)

◆ RedoJob()

TJobStatus CQueue::RedoJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job 
)

◆ RegisterQueueResumeNotification()

void CQueue::RegisterQueueResumeNotification ( unsigned int  address,
unsigned short  port,
bool  new_format 
)

◆ RegisterSocketWriteError()

void CQueue::RegisterSocketWriteError ( const CNSClientId client)

◆ RemoveDump()

void CQueue::RemoveDump ( const string dump_dir_name)

◆ RereadJob()

TJobStatus CQueue::RereadJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
bool no_op 
)

◆ RescheduleJob()

TJobStatus CQueue::RescheduleJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
const string auth_token,
const string aff_token,
const string group,
bool auth_token_ok,
CJob job 
)

◆ RestorePauseStatus()

void CQueue::RestorePauseStatus ( TPauseStatus  status)
inline

Definition at line 460 of file ns_queue.hpp.

References m_PauseStatus.

◆ ReturnJob()

TJobStatus CQueue::ReturnJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
string warning,
TJobReturnOption  how 
)

◆ ReturnReadingJob()

TJobStatus CQueue::ReturnReadingJob ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
bool  is_ns_rollback,
bool  blacklist,
TJobStatus  target_status 
)

◆ SetAffinity()

void CQueue::SetAffinity ( const CNSClientId client,
const list< string > &  aff,
ECommandGroup  cmd_group 
)

◆ SetClientData()

int CQueue::SetClientData ( const CNSClientId client,
const string data,
int  data_version 
)

◆ SetClientScope()

void CQueue::SetClientScope ( const CNSClientId client)

◆ SetJobListener()

TJobStatus CQueue::SetJobListener ( unsigned int  job_id,
CJob job,
unsigned int  address,
unsigned short  port,
const CNSPreciseTime timeout,
bool  need_stolen,
bool  need_progress_msg,
size_t *  last_event_index 
)

◆ SetParameters()

void CQueue::SetParameters ( const SQueueParameters params)

Definition at line 159 of file ns_queue.cpp.

References CQueueClientInfoList::AddClientInfo(), SQueueParameters::blacklist_time, SQueueParameters::CalculateRuntimePrecision(), CQueueClientInfoList::Clear(), SQueueParameters::client_registry_min_admins, SQueueParameters::client_registry_min_readers, SQueueParameters::client_registry_min_submitters, SQueueParameters::client_registry_min_unknowns, SQueueParameters::client_registry_min_worker_nodes, SQueueParameters::client_registry_timeout_admin, SQueueParameters::client_registry_timeout_reader, SQueueParameters::client_registry_timeout_submitter, SQueueParameters::client_registry_timeout_unknown, SQueueParameters::client_registry_timeout_worker_node, SQueueParameters::dump_aff_buffer_size, SQueueParameters::dump_buffer_size, SQueueParameters::dump_client_buffer_size, SQueueParameters::dump_group_buffer_size, SQueueParameters::failed_retries, SQueueParameters::linked_sections, m_BlacklistTime, m_ClientRegistryMinAdmins, m_ClientRegistryMinReaders, m_ClientRegistryMinSubmitters, m_ClientRegistryMinUnknowns, m_ClientRegistryMinWorkerNodes, m_ClientRegistryTimeoutAdmin, m_ClientRegistryTimeoutReader, m_ClientRegistryTimeoutSubmitter, m_ClientRegistryTimeoutUnknown, m_ClientRegistryTimeoutWorkerNode, m_ClientsRegistry, m_DumpAffBufferSize, m_DumpBufferSize, m_DumpClientBufferSize, m_DumpGroupBufferSize, m_FailedRetries, m_HandicapTimeout, m_LinkedSections, m_MaxInputSize, m_MaxJobsPerClient, m_MaxOutputSize, m_MaxPendingReadWaitTimeout, m_MaxPendingWaitTimeout, m_NotifHifreqInterval, m_NotifHifreqPeriod, m_NotifLofreqMult, m_ParamLock, m_PendingTimeout, m_ProgramVersionList, m_ReadBlacklistTime, m_ReaderHosts, m_ReaderTimeout, m_ReadFailedRetries, m_ReadTimeout, m_RunTimeLine, m_RunTimeout, m_ScrambleJobKeys, m_SubmHosts, m_Timeout, m_WnodeHosts, m_WNodeTimeout, SQueueParameters::max_input_size, SQueueParameters::max_jobs_per_client, SQueueParameters::max_output_size, SQueueParameters::max_pending_read_wait_timeout, SQueueParameters::max_pending_wait_timeout, SQueueParameters::notif_handicap, SQueueParameters::notif_hifreq_interval, SQueueParameters::notif_hifreq_period, SQueueParameters::notif_lofreq_mult, SQueueParameters::pending_timeout, precision, SQueueParameters::program_name, SQueueParameters::qclass, SQueueParameters::read_blacklist_time, SQueueParameters::read_failed_retries, SQueueParameters::read_timeout, SQueueParameters::reader_hosts, SQueueParameters::reader_timeout, SQueueParameters::run_timeout, SQueueParameters::scramble_job_keys, CNSClientsRegistry::SetBlacklistTimeouts(), CNetScheduleAccessList::SetHosts(), SQueueParameters::subm_hosts, SQueueParameters::timeout, UpdatePerfLoggingSettings(), SQueueParameters::wnode_hosts, and SQueueParameters::wnode_timeout.

◆ SetPauseStatus()

void CQueue::SetPauseStatus ( const CNSClientId client,
TPauseStatus  status 
)

◆ SetRefuseSubmits()

void CQueue::SetRefuseSubmits ( bool  val)
inline

Definition at line 137 of file ns_queue.hpp.

References m_RefuseSubmits, and val.

Referenced by CNetScheduleHandler::x_ProcessRefuseSubmits().

◆ ShouldPerfLogTransitions()

bool CQueue::ShouldPerfLogTransitions ( void  ) const
inline

Definition at line 470 of file ns_queue.hpp.

References m_ShouldPerfLogTransitions.

Referenced by g_DoErasePerfLogging(), and g_DoPerfLogging().

◆ StaleNodes()

void CQueue::StaleNodes ( const CNSPreciseTime current_time)

◆ StatusStatistics()

void CQueue::StatusStatistics ( TJobStatus  status,
TNSBitVector::statistics st 
) const

◆ Submit()

unsigned int CQueue::Submit ( const CNSClientId client,
CJob job,
const string aff_token,
const string group,
bool  logging,
CNSRollbackInterface *&  rollback_action 
)

◆ SubmitBatch()

unsigned int CQueue::SubmitBatch ( const CNSClientId client,
vector< pair< CJob, string > > &  batch,
const string group,
bool  logging,
CNSRollbackInterface *&  rollback_action 
)

◆ TimeLineAdd()

void CQueue::TimeLineAdd ( unsigned int  job_id,
const CNSPreciseTime job_time 
)

◆ TimeLineExchange()

void CQueue::TimeLineExchange ( unsigned int  remove_job_id,
unsigned int  add_job_id,
const CNSPreciseTime new_time 
)

◆ TimeLineMove()

void CQueue::TimeLineMove ( unsigned int  job_id,
const CNSPreciseTime old_time,
const CNSPreciseTime new_time 
)

◆ TimeLineRemove()

void CQueue::TimeLineRemove ( unsigned int  job_id)

◆ TouchClientsRegistry()

void CQueue::TouchClientsRegistry ( CNSClientId client,
bool client_was_found,
bool session_was_reset,
string old_session,
bool had_wn_pref_affs,
bool had_reader_pref_affs 
)

◆ UpdatePerfLoggingSettings()

void CQueue::UpdatePerfLoggingSettings ( const string qclass)

◆ x_CancelJobs()

unsigned int CQueue::x_CancelJobs ( const CNSClientId client,
const TNSBitVector jobs_to_cancel,
bool  logging 
)
private

◆ x_ChangeReadingStatus()

TJobStatus CQueue::x_ChangeReadingStatus ( const CNSClientId client,
unsigned int  job_id,
const string job_key,
CJob job,
const string auth_token,
const string err_msg,
TJobStatus  target_status,
bool  is_ns_rollback,
bool  no_retries 
)
private

◆ x_CheckExecutionTimeout()

void CQueue::x_CheckExecutionTimeout ( const CNSPreciseTime queue_run_timeout,
const CNSPreciseTime queue_read_timeout,
unsigned  job_id,
const CNSPreciseTime curr_time,
bool  logging 
)
private

◆ x_ClearQueue()

void CQueue::x_ClearQueue ( void  )
private

◆ x_DumpJobs()

string CQueue::x_DumpJobs ( const TNSBitVector jobs_to_dump,
unsigned int  start_after_job_id,
unsigned int  count,
TDumpFields  dump_fields,
bool  order_first 
)
private

◆ x_Erase()

void CQueue::x_Erase ( const TNSBitVector job_ids,
TJobStatus  status 
)
private

Erase jobs from all structures, request delayed db deletion.

Definition at line 2489 of file ns_queue.cpp.

References bm::bvector< Alloc >::count(), CStatisticsCounters::CountTransitionToDeleted(), m_JobsToDelete, m_JobsToDeleteLock, m_JobsToDeleteOps, and m_StatisticsCounters.

Referenced by CheckJobsExpiry().

◆ x_FindOutdatedJobForReading() [1/2]

CQueue::x_SJobPick CQueue::x_FindOutdatedJobForReading ( const CNSClientId client,
unsigned int  picked_earlier,
const TNSBitVector group_ids 
)
private

◆ x_FindOutdatedJobForReading() [2/2]

CQueue::x_SJobPick CQueue::x_FindOutdatedJobForReading ( const CNSClientId client,
unsigned int  picked_earlier,
const TNSBitVector group_ids,
const string scope 
)
private

◆ x_FindOutdatedPendingJob() [1/2]

CQueue::x_SJobPick CQueue::x_FindOutdatedPendingJob ( const CNSClientId client,
unsigned int  picked_earlier,
const TNSBitVector group_ids 
)
private

Definition at line 2865 of file ns_queue.cpp.

References client, CQueue::x_SJobPick::job_id, kTimeZero, and m_MaxPendingWaitTimeout.

Referenced by GetJobOrWait().

◆ x_FindOutdatedPendingJob() [2/2]

CQueue::x_SJobPick CQueue::x_FindOutdatedPendingJob ( const CNSClientId client,
unsigned int  picked_earlier,
const TNSBitVector group_ids,
const string scope 
)
private

◆ x_FindVacantJob() [1/2]

CQueue::x_SJobPick CQueue::x_FindVacantJob ( const CNSClientId client,
const TNSBitVector explicit_affs,
const vector< unsigned int > &  aff_ids,
bool  use_pref_affinity,
bool  any_affinity,
bool  exclusive_new_affinity,
bool  prioritized_aff,
const TNSBitVector group_ids,
bool  has_groups,
ECommandGroup  cmd_group 
)
private

Definition at line 2510 of file ns_queue.cpp.

References client, and CQueue::x_SJobPick::job_id.

Referenced by GetJobForReadingOrWait(), and GetJobOrWait().

◆ x_FindVacantJob() [2/2]

CQueue::x_SJobPick CQueue::x_FindVacantJob ( const CNSClientId client,
const TNSBitVector explicit_affs,
const vector< unsigned int > &  aff_ids,
bool  use_pref_affinity,
bool  any_affinity,
bool  exclusive_new_affinity,
bool  prioritized_aff,
const TNSBitVector group_ids,
bool  has_groups,
ECommandGroup  cmd_group,
const string scope 
)
private

◆ x_GetEstimatedJobLifetime()

CNSPreciseTime CQueue::x_GetEstimatedJobLifetime ( unsigned int  job_id,
TJobStatus  status 
) const
private

◆ x_GetJobsDumpFileName()

string CQueue::x_GetJobsDumpFileName ( const string dump_dname) const
private

Definition at line 4721 of file ns_queue.cpp.

References kJobsFileName(), m_QueueName, and NStr::ToUpper().

Referenced by Dump(), LoadFromDump(), and RemoveDump().

◆ x_GetRunningJobsPerClientIP()

map< string, size_t > CQueue::x_GetRunningJobsPerClientIP ( void  )
private

◆ x_LogSubmit()

void CQueue::x_LogSubmit ( const CJob job)
private

◆ x_NoMoreReadJobs()

bool CQueue::x_NoMoreReadJobs ( const CNSClientId client,
const TNSBitVector aff_list,
bool  reader_affinity,
bool  any_affinity,
bool  exclusive_new_affinity,
const TNSBitVector group_list,
bool  affinity_may_change,
bool  group_may_change 
)
private

◆ x_NotifyJobChanges()

void CQueue::x_NotifyJobChanges ( const CJob job,
const string job_key,
ENotificationReason  reason,
const CNSPreciseTime current_time 
)
private

◆ x_RegisterGetListener()

void CQueue::x_RegisterGetListener ( const CNSClientId client,
unsigned short  port,
unsigned int  timeout,
const TNSBitVector aff_ids,
bool  wnode_aff,
bool  any_aff,
bool  exclusive_new_affinity,
bool  new_format,
const TNSBitVector group_ids 
)
private

◆ x_RegisterReadListener()

void CQueue::x_RegisterReadListener ( const CNSClientId client,
unsigned short  port,
unsigned int  timeout,
const TNSBitVector aff_ids,
bool  reader_aff,
bool  any_aff,
bool  exclusive_new_affinity,
const TNSBitVector group_ids 
)
private

◆ x_ResetDueTo()

TJobStatus CQueue::x_ResetDueTo ( const CNSClientId client,
unsigned int  job_id,
const CNSPreciseTime current_time,
TJobStatus  status_from,
CJobEvent::EJobEvent  event_type 
)
private

◆ x_ResetReadingDueToClear()

void CQueue::x_ResetReadingDueToClear ( const CNSClientId client,
const TNSBitVector jobs 
)
private

◆ x_ResetReadingDueToNewSession()

void CQueue::x_ResetReadingDueToNewSession ( const CNSClientId client,
const TNSBitVector jobs 
)
private

◆ x_ResetRunningDueToClear()

void CQueue::x_ResetRunningDueToClear ( const CNSClientId client,
const TNSBitVector jobs 
)
private

◆ x_ResetRunningDueToNewSession()

void CQueue::x_ResetRunningDueToNewSession ( const CNSClientId client,
const TNSBitVector jobs 
)
private

◆ x_UnregisterGetListener()

bool CQueue::x_UnregisterGetListener ( const CNSClientId client,
unsigned short  port 
)
private

◆ x_UpdateDB_ProvideJobNoLock()

void CQueue::x_UpdateDB_ProvideJobNoLock ( const CNSClientId client,
const CNSPreciseTime curr,
unsigned int  job_id,
ECommandGroup  cmd_group,
CJob job 
)
private

◆ x_UpdateDB_PutResultNoLock()

void CQueue::x_UpdateDB_PutResultNoLock ( unsigned  job_id,
const string auth_token,
const CNSPreciseTime curr,
int  ret_code,
const string output,
CJob job,
const CNSClientId client 
)
private

◆ x_ValidateMaxJobsPerClientIP()

bool CQueue::x_ValidateMaxJobsPerClientIP ( unsigned int  job_id,
const map< string, size_t > &  jobs_per_client_ip 
) const
private

Friends And Related Function Documentation

◆ CJob

friend class CJob
friend

Definition at line 631 of file ns_queue.hpp.

◆ CQueueParamAccessor

friend class CQueueParamAccessor
friend

Definition at line 632 of file ns_queue.hpp.

Member Data Documentation

◆ m_AffinityRegistry

CNSAffinityRegistry CQueue::m_AffinityRegistry
private

◆ m_BlacklistTime

CNSPreciseTime CQueue::m_BlacklistTime
private

Definition at line 683 of file ns_queue.hpp.

Referenced by CQueueParamAccessor::GetParamValue(), and SetParameters().

◆ m_ClientRegistryMinAdmins

unsigned int CQueue::m_ClientRegistryMinAdmins
private

Definition at line 738 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryMinReaders

unsigned int CQueue::m_ClientRegistryMinReaders
private

Definition at line 742 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryMinSubmitters

unsigned int CQueue::m_ClientRegistryMinSubmitters
private

Definition at line 740 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryMinUnknowns

unsigned int CQueue::m_ClientRegistryMinUnknowns
private

Definition at line 744 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryMinWorkerNodes

unsigned int CQueue::m_ClientRegistryMinWorkerNodes
private

Definition at line 736 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryTimeoutAdmin

CNSPreciseTime CQueue::m_ClientRegistryTimeoutAdmin
private

Definition at line 737 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryTimeoutReader

CNSPreciseTime CQueue::m_ClientRegistryTimeoutReader
private

Definition at line 741 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryTimeoutSubmitter

CNSPreciseTime CQueue::m_ClientRegistryTimeoutSubmitter
private

Definition at line 739 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryTimeoutUnknown

CNSPreciseTime CQueue::m_ClientRegistryTimeoutUnknown
private

Definition at line 743 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientRegistryTimeoutWorkerNode

CNSPreciseTime CQueue::m_ClientRegistryTimeoutWorkerNode
private

Definition at line 735 of file ns_queue.hpp.

Referenced by PurgeClientRegistry(), and SetParameters().

◆ m_ClientsRegistry

CNSClientsRegistry CQueue::m_ClientsRegistry
private

◆ m_DumpAffBufferSize

unsigned int CQueue::m_DumpAffBufferSize
private

◆ m_DumpBufferSize

unsigned int CQueue::m_DumpBufferSize
private

Definition at line 719 of file ns_queue.hpp.

Referenced by CQueueParamAccessor::GetParamValue(), SetParameters(), and x_DumpJobs().

◆ m_DumpClientBufferSize

unsigned int CQueue::m_DumpClientBufferSize
private

◆ m_DumpGroupBufferSize

unsigned int CQueue::m_DumpGroupBufferSize
private

◆ m_FailedRetries

unsigned CQueue::m_FailedRetries
private

◆ m_GCRegistry

CJobGCRegistry CQueue::m_GCRegistry
private

◆ m_GroupRegistry

CNSGroupsRegistry CQueue::m_GroupRegistry
private

◆ m_HandicapTimeout

CNSPreciseTime CQueue::m_HandicapTimeout
private

◆ m_Jobs

map<unsigned int, CJob> CQueue::m_Jobs
private

◆ m_JobsToDelete

TNSBitVector CQueue::m_JobsToDelete
private

◆ m_JobsToDeleteLock

CFastMutex CQueue::m_JobsToDeleteLock
mutableprivate

◆ m_JobsToDeleteOps

unsigned int CQueue::m_JobsToDeleteOps
private

Definition at line 667 of file ns_queue.hpp.

Referenced by DeleteBatch(), EraseJob(), and x_Erase().

◆ m_KeyGenerator

CNetScheduleKeyGenerator CQueue::m_KeyGenerator
private

Definition at line 701 of file ns_queue.hpp.

Referenced by MakeJobKey().

◆ m_Kind

TQueueKind CQueue::m_Kind
private

Definition at line 645 of file ns_queue.hpp.

Referenced by GetQueueKind().

◆ m_LastId

unsigned int CQueue::m_LastId
private

Definition at line 657 of file ns_queue.hpp.

Referenced by Attach(), GetNextId(), and GetNextJobIdForBatch().

◆ m_LastIdLock

CFastMutex CQueue::m_LastIdLock
private

Definition at line 660 of file ns_queue.hpp.

Referenced by GetNextId(), and GetNextJobIdForBatch().

◆ m_LinkedSections

map<string, string> CQueue::m_LinkedSections
private

Definition at line 724 of file ns_queue.hpp.

Referenced by GetLinkedSections(), and SetParameters().

◆ m_Log

const bool& CQueue::m_Log
private

Definition at line 703 of file ns_queue.hpp.

Referenced by FailJob(), PurgeClientRegistry(), and StaleNodes().

◆ m_LogBatchEachJob

const bool& CQueue::m_LogBatchEachJob
private

Definition at line 704 of file ns_queue.hpp.

Referenced by SubmitBatch().

◆ m_MaxInputSize

unsigned CQueue::m_MaxInputSize
private

◆ m_MaxJobsPerClient

unsigned CQueue::m_MaxJobsPerClient
private

◆ m_MaxOutputSize

unsigned CQueue::m_MaxOutputSize
private

◆ m_MaxPendingReadWaitTimeout

CNSPreciseTime CQueue::m_MaxPendingReadWaitTimeout
private

◆ m_MaxPendingWaitTimeout

CNSPreciseTime CQueue::m_MaxPendingWaitTimeout
private

◆ m_NotifHifreqInterval

CNSPreciseTime CQueue::m_NotifHifreqInterval
private

◆ m_NotifHifreqPeriod

CNSPreciseTime CQueue::m_NotifHifreqPeriod
private

◆ m_NotificationsList

CNSNotificationList CQueue::m_NotificationsList
private

◆ m_NotifLofreqMult

unsigned int CQueue::m_NotifLofreqMult
private

◆ m_OperationLock

CFastMutex CQueue::m_OperationLock
mutableprivate

◆ m_ParamLock

CFastMutex CQueue::m_ParamLock
mutableprivate

Definition at line 675 of file ns_queue.hpp.

Referenced by SetParameters().

◆ m_PauseStatus

TPauseStatus CQueue::m_PauseStatus
private

◆ m_PendingTimeout

CNSPreciseTime CQueue::m_PendingTimeout
private

◆ m_ProgramVersionList

CQueueClientInfoList CQueue::m_ProgramVersionList
private

◆ m_QueueDB

CQueueDataBase& CQueue::m_QueueDB
private

Definition at line 636 of file ns_queue.hpp.

Referenced by GetLinkedSections().

◆ m_QueueName

string CQueue::m_QueueName
private

◆ m_ReadBlacklistTime

CNSPreciseTime CQueue::m_ReadBlacklistTime
private

Definition at line 684 of file ns_queue.hpp.

Referenced by CQueueParamAccessor::GetParamValue(), and SetParameters().

◆ m_ReaderHosts

CNetScheduleAccessList CQueue::m_ReaderHosts
private

Definition at line 699 of file ns_queue.hpp.

Referenced by IsReaderAllowed(), and SetParameters().

◆ m_ReaderTimeout

CNSPreciseTime CQueue::m_ReaderTimeout
private

Definition at line 688 of file ns_queue.hpp.

Referenced by SetParameters(), and StaleNodes().

◆ m_ReadFailedRetries

unsigned CQueue::m_ReadFailedRetries
private

◆ m_ReadJobs

TNSBitVector CQueue::m_ReadJobs
private

◆ m_ReadJobsOps

unsigned int CQueue::m_ReadJobsOps
private

◆ m_ReadTimeout

CNSPreciseTime CQueue::m_ReadTimeout
private

◆ m_RefuseSubmits

bool CQueue::m_RefuseSubmits
private

Definition at line 706 of file ns_queue.hpp.

Referenced by GetRefuseSubmits(), and SetRefuseSubmits().

◆ m_RunTimeLine

CJobTimeLine* CQueue::m_RunTimeLine
private

◆ m_RunTimeLineLock

CRWLock CQueue::m_RunTimeLineLock
private

◆ m_RunTimeout

CNSPreciseTime CQueue::m_RunTimeout
private

◆ m_SavedId

unsigned int CQueue::m_SavedId
private

Definition at line 658 of file ns_queue.hpp.

Referenced by Attach(), GetNextId(), and GetNextJobIdForBatch().

◆ m_ScopeRegistry

CNSScopeRegistry CQueue::m_ScopeRegistry
private

◆ m_ScrambleJobKeys

bool CQueue::m_ScrambleJobKeys
private

Definition at line 723 of file ns_queue.hpp.

Referenced by CQueueParamAccessor::GetParamValue(), MakeJobKey(), and SetParameters().

◆ m_Server

CNetScheduleServer* CQueue::m_Server
private

◆ m_ShouldPerfLogTransitions

bool CQueue::m_ShouldPerfLogTransitions
private

Definition at line 748 of file ns_queue.hpp.

Referenced by ShouldPerfLogTransitions(), and UpdatePerfLoggingSettings().

◆ m_StatesForRead

vector<CNetScheduleAPI::EJobStatus> CQueue::m_StatesForRead
private

Definition at line 752 of file ns_queue.hpp.

Referenced by CQueue(), x_FindVacantJob(), and x_NoMoreReadJobs().

◆ m_StatisticsCounters

CStatisticsCounters CQueue::m_StatisticsCounters
private

◆ m_StatisticsCountersLastPrinted

CStatisticsCounters CQueue::m_StatisticsCountersLastPrinted
mutableprivate

Definition at line 709 of file ns_queue.hpp.

Referenced by PrintStatistics().

◆ m_StatisticsCountersLastPrintedTimestamp

CNSPreciseTime CQueue::m_StatisticsCountersLastPrintedTimestamp
mutableprivate

Definition at line 710 of file ns_queue.hpp.

Referenced by PrintStatistics().

◆ m_StatusTracker

CJobStatusTracker CQueue::m_StatusTracker
private

◆ m_SubmHosts

CNetScheduleAccessList CQueue::m_SubmHosts
private

◆ m_Timeout

CNSPreciseTime CQueue::m_Timeout
private

◆ m_WnodeHosts

CNetScheduleAccessList CQueue::m_WnodeHosts
private

◆ m_WNodeTimeout

CNSPreciseTime CQueue::m_WNodeTimeout
private

Definition at line 687 of file ns_queue.hpp.

Referenced by SetParameters(), and StaleNodes().


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