1 #ifndef NS_GET_NOTIFICATIONS__HPP
2 #define NS_GET_NOTIFICATIONS__HPP
126 const string & ns_node,
127 const string & qname);
131 unsigned int timeout,
134 bool exclusive_new_affinity,
146 const string & notification);
149 const string & job_key,
156 unsigned int notif_lofreq_mult,
162 void Notify(
unsigned int job_id,
216 list<SNSNotificationAttributes> & container,
217 list<SNSNotificationAttributes>::iterator & record);
231 list<SNSNotificationAttributes>::iterator
233 unsigned int address,
268 unsigned int sec_delay,
269 unsigned int nanosec_delay,
270 const bool & logging);
281 virtual void *
Main(
void);
virtual void * Main(void)
Derived (user-created) class must provide a real thread function.
CNSPreciseTime m_NextScheduled
CGetJobNotificationThread(const CGetJobNotificationThread &)
const bool & m_NotifLogging
CGetJobNotificationThread & operator=(const CGetJobNotificationThread &)
CQueueDataBase & m_QueueDB
CNSPreciseTime x_ProcessExactTimeNotifications(void)
CGetJobNotificationThread(CQueueDataBase &qdb, unsigned int sec_delay, unsigned int nanosec_delay, const bool &logging)
~CGetJobNotificationThread()
string BuildJobChangedNotification(const CJob &job, const string &job_key, TJobStatus job_status, ENotificationReason reason)
CFastMutex m_GetAndReadNotificationSocketLock
void x_SendNotificationPacket(unsigned int address, unsigned short port, bool new_format, ECommandGroup reason)
list< SExactTimeNotification > m_ExactTimeNotifications
char m_GetMsgBufferObsoleteVersion[k_MessageBufferSize]
CDatagramSocket m_GetAndReadNotificationSocket
void onQueueResumed(bool any_pending)
CNSPreciseTime GetPassiveNotificationLifetime(unsigned int address, unsigned short port, ECommandGroup cmd_group) const
CMutex m_ExactTimeNotifLock
CMutex m_QueueResumeNotifLock
char m_ReadMsgBuffer[k_MessageBufferSize]
void Notify(unsigned int job_id, unsigned int aff_id, CNSClientsRegistry &clients_registry, CNSAffinityRegistry &aff_registry, CNSGroupsRegistry &group_registry, CNSScopeRegistry &scope_registry, const CNSPreciseTime ¬if_highfreq_period, const CNSPreciseTime ¬if_handicap, ECommandGroup cmd_group)
void AddToQueueResumedNotifications(unsigned int address, unsigned short port, bool new_format)
list< SNSNotificationAttributes > m_PassiveListeners
void x_AddToExactNotifications(unsigned int address, unsigned short port, const CNSPreciseTime &when, bool new_format, ECommandGroup reason)
void NotifyJobChanges(unsigned int address, unsigned short port, const string ¬ification)
CNSNotificationList(const CNSNotificationList &)
void UnregisterListener(const CNSClientId &client, unsigned short port, ECommandGroup cmd_group)
void CheckOutdatedJobs(const TNSBitVector &outdated_jobs, CNSClientsRegistry &clients_registry, const CNSPreciseTime ¬if_highfreq_period, ECommandGroup cmd_group)
void ClearExactGetNotifications(void)
list< SQueueResumeNotification > m_QueueResumeNotifications
CQueueDataBase & m_QueueDB
bool x_TestTimeout(const CNSPreciseTime ¤t_time, CNSClientsRegistry &clients_registry, list< SNSNotificationAttributes > &container, list< SNSNotificationAttributes >::iterator &record)
void CheckTimeout(const CNSPreciseTime ¤t_time, CNSClientsRegistry &clients_registry, ECommandGroup cmd_group)
void NotifyPeriodically(const CNSPreciseTime ¤t_time, unsigned int notif_lofreq_mult, CNSClientsRegistry &clients_registry)
CFastMutex m_StatusNotificationSocketLock
CDatagramSocket m_StatusNotificationSocket
string m_JobChangeNotifConstPart
list< SNSNotificationAttributes > m_ActiveListeners
char m_GetMsgBuffer[k_MessageBufferSize]
list< SNSNotificationAttributes >::iterator x_FindListener(list< SNSNotificationAttributes > &container, unsigned int address, unsigned short port, ECommandGroup cmd_group)
size_t m_GetMsgLengthObsoleteVersion
void RegisterListener(const CNSClientId &client, unsigned short port, unsigned int timeout, bool wnode_aff, bool any_job, bool exclusive_new_affinity, bool new_format, const TNSBitVector &groups, ECommandGroup cmd_group)
CNSNotificationList & operator=(const CNSNotificationList &)
string Print(const CNSClientsRegistry &clients_registry, const CNSAffinityRegistry &aff_registry, const CNSGroupsRegistry &group_registry, bool verbose) const
CNSPreciseTime NotifyExactListeners(void)
CNSNotificationList(CQueueDataBase &qdb, const string &ns_node, const string &qname)
bool x_IsInExactList(unsigned int address, unsigned short port) const
Bitvector Bit-vector container with runtime compression of bits.
EJobStatus
Job status codes.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Multi-threading – mutexes; rw-locks; semaphore.
Multi-threading – classes, functions, and features.
const size_t k_MessageBufferSize
static CNamedPipeClient * client
CNSPreciseTime m_TimeToSend
unsigned int m_SlowRateCount
CNSPreciseTime m_HifreqNotifyLifetime
CNSPreciseTime m_Lifetime
string Print(const CNSClientsRegistry &clients_registry, const CNSAffinityRegistry &aff_registry, const CNSGroupsRegistry &group_registry, bool is_active, bool verbose) const