NCBI C++ ToolKit
ns_clients.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef NETSCHEDULE_CLIENTS__HPP
2 #define NETSCHEDULE_CLIENTS__HPP
3 
4 /* $Id: ns_clients.hpp 84252 2018-10-29 17:37:51Z satskyse $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergey Satskiy
30  *
31  * File Description:
32  * NetSchedule clients registry supporting facilities
33  *
34  */
35 
37 
38 #include "ns_types.hpp"
39 #include "ns_access.hpp"
40 #include "ns_precise_time.hpp"
41 
42 #include <string>
43 
44 
46 
47 // Forward declaration
48 class CQueue;
50 class CJobStatusTracker;
51 class CNetScheduleServer;
52 
53 
54 // The client can claim that it belongs to a certain type
60  eClaimedAutodetect, // The detection of the type must be done basing
61  // on the issued commands
62  eClaimedReset, // Reset the collected type bits (based on commands)
63  // and switch to auto
65 };
66 
67 
68 
69 // The CClientId serves two types of clients:
70 // - old style clients; they have peer address only
71 // - new style clients; they have all three pieces,
72 // address, node id and session id
74 {
75  public:
76  CNSClientId();
77  void Update(unsigned int peer_addr,
78  const TNSProtoParams & params);
79 
80  // true if it is a new client identification
81  bool IsComplete(void) const;
82 
83  // Getters/setters
84  unsigned int GetAddress(void) const
85  { return m_Addr; }
86  const string & GetNode(void) const
87  { return m_ClientNode; }
88  const string & GetSession(void) const
89  { return m_ClientSession; }
91  { return m_ClientType; }
93  { m_ClientType = new_type; }
94  unsigned short GetControlPort(void) const
95  { return m_ControlPort; }
96  const string & GetClientHost(void) const
97  { return m_ClientHost; }
98  const string & GetProgramName(void) const
99  { return m_ProgName; }
100  const string & GetClientName(void) const
101  { return m_ClientName; }
102  void SetClientName(const string & client_name);
103  void SetClientHost(const string & client_host)
104  { m_ClientHost = client_host; }
105  void SetControlPort(unsigned short port)
106  { m_ControlPort = port; }
107  unsigned int GetID(void) const
108  { return m_ID; }
109  void SetID(unsigned int id)
110  { m_ID = id; }
111 
112  bool IsAdmin(void) const
113  { return (m_PassedChecks & eNS_Admin) != 0; }
115  { m_PassedChecks |= check; }
117  { return m_PassedChecks; }
118 
119  string GetScope(void) const
120  { return m_Scope; }
121  void SetScope(const string & scope)
122  { m_Scope = scope; }
123 
124  // See CXX-5324
125  string GetVirtualScope(void) const;
126 
127  // The admin check is done per connection so there is no need
128  // to reset it when a queue is changed or when a queue is from a job
129  // key.
130  void ResetPassedCheck(void)
131  { if (IsAdmin()) { m_PassedChecks = 0; SetPassedChecks(eNS_Admin); }
132  else { m_PassedChecks = 0; } }
133 
134 
135  void CheckAccess(TNSCommandChecks cmd_reqs,
136  CNetScheduleServer * server,
137  const string & cmd);
138 
139  private:
140  unsigned int m_Addr; // Client peer address
141  string m_ProgName; // Program name - formed by API
142  // and usually is an exe name
143  string m_ClientName; // Client name - taken from the
144  // app config file
145  string m_ClientNode; // Client node,
146  // e.g. service10:9300
147  string m_ClientSession; // Session of working
148  // with netschedule.
149  EClaimedClientType m_ClientType; // Client type, e.g. admin
150  unsigned short m_ControlPort; // Client control port
151  string m_ClientHost; // Client host name if passed in
152  // the handshake line.
153 
154  TNSCommandChecks m_PassedChecks; // What checks the client has
155  // passed successfully
156 
157  // 0 for old style clients
158  // non 0 for new style clients.
159  // This identifier is set at the moment of touching the clients
160  // registry. The id is needed to support affinities. The affinity
161  // registry will store IDs of the clients which informed that a certain
162  // affinity is preferred.
163  unsigned int m_ID;
164 
165  string m_Scope;
166 
167  private:
169  const string & claimed_type) const;
170  string x_NormalizeNodeOrSession(const string & val,
171  const string & key);
172 };
173 
174 
175 
176 // The class stores common data for WNs and readers
178 {
179  public:
180  SRemoteNodeData();
181  SRemoteNodeData(CNSPreciseTime * timeout);
182 
184  { x_UpdateBlacklist();
185  return m_BlacklistedJobs; }
186 
188  {
190  if (m_BlacklistLimits.empty()) return;
191  bv -= m_BlacklistedJobs;
192  }
193 
195  {
197  if (m_BlacklistLimits.empty()) return;
198  bv |= m_BlacklistedJobs;
199  }
200 
201  void ClearJobs(void)
202  { m_Jobs.clear();
203  x_JobsOp(); }
204 
206  { m_PrefAffinities |= aff;
207  x_PrefAffinitiesOp(); }
208 
210  { m_PrefAffinities -= aff;
211  x_PrefAffinitiesOp(); }
212 
213  void RemovePreferredAffinity(unsigned int aff)
214  { m_PrefAffinities.set_bit(aff, false);
215  x_PrefAffinitiesOp(); }
216 
218  { m_PrefAffinities = aff;
219  m_AffReset = false;
220  x_PrefAffinitiesOp(); }
221 
222  void SetWaitAffinities(const TNSBitVector & aff)
223  { m_WaitAffinities = aff;
224  x_WaitAffinitiesOp(); }
225 
228  x_WaitAffinitiesOp(); }
229 
230  void UpdateBlacklist(unsigned int job_id) const;
231  string GetBlacklistLimit(unsigned int job_id) const;
232  void AddToBlacklist(unsigned int job_id,
233  const CNSPreciseTime & last_access);
234  bool ClearPreferredAffinities(void);
235  void RegisterJob(unsigned int job_id);
236  void UnregisterGivenJob(unsigned int job_id);
237  bool MoveJobToBlacklist(unsigned int job_id);
238  bool AddPreferredAffinity(unsigned int aff);
239  bool IsRequestedAffinity(const TNSBitVector & aff,
240  bool use_preferred) const;
242  const vector<TJobStatus> & match_states);
243  void CancelWaiting(void);
244 
245  public:
247 
248  // Running or reading jobs
250 
251  // Black list support
254  mutable
255  map<unsigned int,
257 
258  // GET2/WGET or READ wait port
259  unsigned short m_WaitPort;
260 
261  // Affinities support
265 
266  private:
267  mutable size_t m_JobsOpCount;
268  mutable size_t m_BlacklistedJobsOpCount;
269  mutable size_t m_PrefAffinitiesOpCount;
270  mutable size_t m_WaitAffinitiesOpCount;
271 
272  private:
276  }
277 
278  void x_UpdateBlacklist(void) const;
279  void x_JobsOp(void) const;
280  void x_BlacklistedOp(void) const;
281  void x_PrefAffinitiesOp(void) const;
282  void x_WaitAffinitiesOp(void) const;
283 };
284 
285 
286 // The CNSClient stores information about new style clients only;
287 // The information includes the given jobs,
288 // type of the client (worker node, submitter) etc.
289 
290 // Note: access to the instances of this class is possible only via the client
291 // registry and the corresponding container access is always done under a lock.
292 // So it is safe to do any modifications in the members without any locks here.
294 {
295  public:
296  // Used for a bit mask to identify what kind of
297  // operations the client tried to perform
301  eReader = 4,
302  eAdmin = 8
303  };
304 
306  eActive = 1,
307  eWNStale = 2,
310  eQuit = 16
311  };
312 
313  public:
314  CNSClient();
315  CNSClient(const CNSClientId & client_id,
316  CNSPreciseTime * blacklist_timeout,
317  CNSPreciseTime * read_blacklist_timeout);
318  CNSClient(const CNSClient &) = default;
319  CNSClient & operator=(const CNSClient &) = default;
320  CNSClient(CNSClient &&) = default;
321  CNSClient & operator=(CNSClient &&) = default;
322 
324  { if (cmd_group == eGet) return m_WNData.m_Jobs;
325  return m_ReaderData.m_Jobs; }
326 
327  void ClearJobs(ECommandGroup cmd_group)
328  { if (cmd_group == eGet) m_WNData.ClearJobs();
329  else m_ReaderData.ClearJobs();
330  }
331 
333  TNSBitVector & bv) const
334  { if (cmd_group == eGet) m_WNData.SubtractBlacklistedJobs(bv);
336 
338  TNSBitVector & bv) const
339  { if (cmd_group == eGet) m_WNData.AddBlacklistedJobs(bv);
340  else m_ReaderData.AddBlacklistedJobs(bv); }
341 
342  void SetWaitPort(unsigned short port, ECommandGroup cmd_group)
343  { if (cmd_group == eGet) m_WNData.m_WaitPort = port;
344  m_ReaderData.m_WaitPort = port; }
345 
346  unsigned short GetWaitPort(ECommandGroup cmd_group) const
347  { if (cmd_group == eGet) return m_WNData.m_WaitPort;
348  return m_ReaderData.m_WaitPort; }
349 
350  string GetSession(void) const
351  { return m_Session; }
352 
353  void SetSession(const string & new_session)
354  { m_Session = new_session;
355  if (new_session == "")
357 
359  { return m_LastAccess; }
360 
362  { ++m_NumberOfSockErrors; }
363 
364  unsigned short GetAndResetWaitPort(ECommandGroup cmd_group)
366  if (cmd_group == eGet) data = m_WNData;
367  unsigned short old_port = data.m_WaitPort;
368  data.m_WaitPort = 0;
369  return old_port; }
370 
371  void MarkAsAdmin(void)
372  { m_Type |= eAdmin; }
373 
374  unsigned int GetID(void) const
375  { return m_ID; }
376 
377  void SetID(unsigned int id)
378  { m_ID = id; }
379 
380  unsigned int GetType(void) const
381  { return m_Type; }
382 
383  void AppendType(unsigned int type_to_append)
384  { m_Type |= type_to_append; }
385 
386  bool MoveJobToBlacklist(unsigned int job_id, ECommandGroup cmd_group)
387  { if (cmd_group == eGet) return m_WNData.MoveJobToBlacklist(job_id);
388  return m_ReaderData.MoveJobToBlacklist(job_id); }
389 
390  void UnregisterJob(unsigned int job_id, ECommandGroup cmd_group)
391  { if (cmd_group == eGet) m_WNData.UnregisterGivenJob(job_id);
392  else m_ReaderData.UnregisterGivenJob(job_id); }
393 
395  { return m_State; }
396 
397  void SetState(ENSClientState new_state)
398  { m_State = new_state; }
399 
401  {
402  if (cmd_group == eGet)
403  return m_WNData.m_PrefAffinities;
405  }
406 
407  bool HasPreferredAffinities(ECommandGroup cmd_group) const
408  { if (cmd_group == eGet) return m_WNData.m_PrefAffinities.any();
409  return m_ReaderData.m_PrefAffinities.any(); }
410 
412  { if (cmd_group == eGet) return m_WNData.m_WaitAffinities;
414 
415  bool GetAffinityReset(ECommandGroup cmd_group) const
416  { if (cmd_group == eGet) return m_WNData.m_AffReset;
417  return m_ReaderData.m_AffReset; }
418 
419  void SetAffinityReset(bool value, ECommandGroup cmd_group)
420  { if (cmd_group == eGet) m_WNData.m_AffReset = value;
421  else m_ReaderData.m_AffReset = value; }
422 
423  bool HasWaitAffinities(ECommandGroup cmd_group) const
424  { if (cmd_group == eGet) return m_WNData.m_WaitAffinities.any();
425  return m_ReaderData.m_WaitAffinities.any(); }
426 
427  unsigned int GetPeerAddress(void) const
428  { return m_Addr; }
429 
431  { if (cmd_group == eGet) m_WNData.ClearWaitAffinities();
433 
435  { if (cmd_group == eGet) return m_WNData.ClearPreferredAffinities();
437 
439  ECommandGroup cmd_group)
440  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
442  else { m_Type |= eReader;
444  }
445 
446  bool AddPreferredAffinity(unsigned int aff,
447  ECommandGroup cmd_group)
448  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
449  return m_WNData.AddPreferredAffinity(aff); }
450  m_Type |= eReader;
452  }
453 
455  ECommandGroup cmd_group)
456  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
458  else { m_Type |= eReader;
460  }
461 
462  void RemovePreferredAffinity(unsigned int aff,
463  ECommandGroup cmd_group)
464  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
466  else { m_Type |= eReader;
468  }
469 
471  ECommandGroup cmd_group)
472  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
474  else { m_Type |= eReader;
476  }
477 
478  void SetWaitAffinities(const TNSBitVector & aff,
479  ECommandGroup cmd_group)
480  { if (cmd_group == eGet) { m_Type |= eWorkerNode;
482  else { m_Type |= eReader;
484  }
485 
487  bool use_preferred,
488  ECommandGroup cmd_group) const
489  { if (cmd_group == eGet)
490  return m_WNData.IsRequestedAffinity(aff, use_preferred);
491  return m_ReaderData.IsRequestedAffinity(aff, use_preferred);
492  }
493 
494  void CancelWaiting(ECommandGroup cmd_group)
495  { if (cmd_group == eGet) m_WNData.CancelWaiting();
497  }
498 
500  { m_ClaimedType = new_type; }
501 
502  void RegisterJob(unsigned int job_id,
503  ECommandGroup cmd_group);
504  void RegisterSubmittedJobs(size_t count);
505  void RegisterBlacklistedJob(unsigned int job_id,
506  ECommandGroup cmd_group);
507  int SetClientData(const string & data, int data_version);
509  ECommandGroup cmd_group);
510  void Touch(const CNSClientId & client_id);
511  string Print(const string & node_name,
512  const CQueue * queue,
513  const CNSAffinityRegistry & aff_registry,
514  const set< string > & gc_clients,
515  const set< string > & read_gc_clients,
516  bool verbose) const;
517 
518  void SetLastScope(const string & scope)
519  { m_LastScope = scope; }
520  string GetLastScope(void) const
521  { return m_LastScope; }
522  string GetVirtualScope(const string & client_node) const;
523 
524  private:
525  ENSClientState m_State; // Client state
526  // If true => m_Session == "n/a"
527  unsigned int m_Type; // bit mask of ENSClientType
528 
529  /* Note: at the handshake time a client may claim that it is a certain
530  * type of client. It has nothing to do with how NS decides if an
531  * adminstritive permission required command could be executed. The
532  * member below tells what the client claimed and also how it will be
533  * shown in the STAT CLIENTS output. And nothing else.
534  */
536  unsigned int m_Addr; // Client peer address
537  unsigned short m_ControlPort; // Worker node control port
538  string m_ClientHost; // Client host as given in the
539  // handshake line.
543  CNSPreciseTime m_LastAccess; // The last time the client
544  // accessed netschedule
545  string m_Session;
546  unsigned int m_ID; // Client identifier, see comments
547  // for CNSClientId::m_ID
550 
551  string m_ClientData;
553 
556 
557  string m_LastScope;
558  string m_ProgName;
559 
560  private:
561  string x_TypeAsString(void) const;
562  string x_StateAsString(void) const;
563 };
564 
565 
567 
568 #endif /* NETSCHEDULE_CLIENTS__HPP */
569 
string m_ClientName
Definition: ns_clients.hpp:143
void SetPassedChecks(TNSCommandChecks check)
Definition: ns_clients.hpp:114
string GetScope(void) const
Definition: ns_clients.hpp:119
bool IsAdmin(void) const
Definition: ns_clients.hpp:112
void SetClientHost(const string &client_host)
Definition: ns_clients.hpp:103
void SetScope(const string &scope)
Definition: ns_clients.hpp:121
EClaimedClientType GetType(void) const
Definition: ns_clients.hpp:90
void ResetPassedCheck(void)
Definition: ns_clients.hpp:130
string m_ProgName
Definition: ns_clients.hpp:141
const string & GetClientName(void) const
Definition: ns_clients.hpp:100
unsigned int GetID(void) const
Definition: ns_clients.hpp:107
string x_NormalizeNodeOrSession(const string &val, const string &key)
Definition: ns_clients.cpp:260
unsigned int m_ID
Definition: ns_clients.hpp:163
string m_ClientSession
Definition: ns_clients.hpp:147
bool IsComplete(void) const
Definition: ns_clients.cpp:144
const string & GetProgramName(void) const
Definition: ns_clients.hpp:98
string m_ClientNode
Definition: ns_clients.hpp:145
void SetClientName(const string &client_name)
Definition: ns_clients.cpp:164
const string & GetSession(void) const
Definition: ns_clients.hpp:88
void SetID(unsigned int id)
Definition: ns_clients.hpp:109
const string & GetNode(void) const
Definition: ns_clients.hpp:86
void CheckAccess(TNSCommandChecks cmd_reqs, CNetScheduleServer *server, const string &cmd)
Definition: ns_clients.cpp:170
TNSCommandChecks GetPassedChecks(void) const
Definition: ns_clients.hpp:116
unsigned short m_ControlPort
Definition: ns_clients.hpp:150
EClaimedClientType m_ClientType
Definition: ns_clients.hpp:149
unsigned int m_Addr
Definition: ns_clients.hpp:140
string m_ClientHost
Definition: ns_clients.hpp:151
void Update(unsigned int peer_addr, const TNSProtoParams &params)
Definition: ns_clients.cpp:67
string m_Scope
Definition: ns_clients.hpp:165
void SetClientType(EClaimedClientType new_type)
Definition: ns_clients.hpp:92
const string & GetClientHost(void) const
Definition: ns_clients.hpp:96
void SetControlPort(unsigned short port)
Definition: ns_clients.hpp:105
unsigned int GetAddress(void) const
Definition: ns_clients.hpp:84
EClaimedClientType x_ConvertToClaimedType(const string &claimed_type) const
Definition: ns_clients.cpp:231
TNSCommandChecks m_PassedChecks
Definition: ns_clients.hpp:154
string GetVirtualScope(void) const
Definition: ns_clients.cpp:153
unsigned short GetControlPort(void) const
Definition: ns_clients.hpp:94
string GetLastScope(void) const
Definition: ns_clients.hpp:520
CNSClient & operator=(CNSClient &&)=default
bool GetAffinityReset(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:415
size_t m_NumberOfSockErrors
Definition: ns_clients.hpp:549
void SetID(unsigned int id)
Definition: ns_clients.hpp:377
void SetWaitAffinities(const TNSBitVector &aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:478
bool MoveJobToBlacklist(unsigned int job_id, ECommandGroup cmd_group)
Definition: ns_clients.hpp:386
void UnregisterJob(unsigned int job_id, ECommandGroup cmd_group)
Definition: ns_clients.hpp:390
string Print(const string &node_name, const CQueue *queue, const CNSAffinityRegistry &aff_registry, const set< string > &gc_clients, const set< string > &read_gc_clients, bool verbose) const
Definition: ns_clients.cpp:689
ENSClientState GetState(void) const
Definition: ns_clients.hpp:394
bool ClearPreferredAffinities(ECommandGroup cmd_group)
Definition: ns_clients.hpp:434
TNSBitVector GetWaitAffinities(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:411
string m_ProgName
Definition: ns_clients.hpp:558
void SetWaitPort(unsigned short port, ECommandGroup cmd_group)
Definition: ns_clients.hpp:342
unsigned int GetType(void) const
Definition: ns_clients.hpp:380
void ClearJobs(ECommandGroup cmd_group)
Definition: ns_clients.hpp:327
void RegisterSubmittedJobs(size_t count)
Definition: ns_clients.cpp:631
string m_LastScope
Definition: ns_clients.hpp:557
CNSPreciseTime m_SessionStartTime
Definition: ns_clients.hpp:541
void AddPreferredAffinities(const TNSBitVector &aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:438
void SubtractBlacklistedJobs(ECommandGroup cmd_group, TNSBitVector &bv) const
Definition: ns_clients.hpp:332
TNSBitVector GetJobs(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:323
void SetAffinityReset(bool value, ECommandGroup cmd_group)
Definition: ns_clients.hpp:419
string GetSession(void) const
Definition: ns_clients.hpp:350
int SetClientData(const string &data, int data_version)
Definition: ns_clients.cpp:905
void RegisterJob(unsigned int job_id, ECommandGroup cmd_group)
Definition: ns_clients.cpp:618
CNSPreciseTime m_LastAccess
Definition: ns_clients.hpp:543
unsigned int GetPeerAddress(void) const
Definition: ns_clients.hpp:427
EClaimedClientType m_ClaimedType
Definition: ns_clients.hpp:535
void SetState(ENSClientState new_state)
Definition: ns_clients.hpp:397
void RegisterBlacklistedJob(unsigned int job_id, ECommandGroup cmd_group)
Definition: ns_clients.cpp:639
unsigned int GetID(void) const
Definition: ns_clients.hpp:374
unsigned int m_ID
Definition: ns_clients.hpp:546
CNSPreciseTime m_RegistrationTime
Definition: ns_clients.hpp:540
CNSClient(const CNSClient &)=default
unsigned short m_ControlPort
Definition: ns_clients.hpp:537
string m_Session
Definition: ns_clients.hpp:545
void ClearWaitAffinities(ECommandGroup cmd_group)
Definition: ns_clients.hpp:430
unsigned short GetWaitPort(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:346
void CancelWaiting(ECommandGroup cmd_group)
Definition: ns_clients.hpp:494
bool AddPreferredAffinity(unsigned int aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:446
int m_ClientDataVersion
Definition: ns_clients.hpp:552
unsigned short GetAndResetWaitPort(ECommandGroup cmd_group)
Definition: ns_clients.hpp:364
string m_ClientData
Definition: ns_clients.hpp:551
bool HasWaitAffinities(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:423
ENSClientState m_State
Definition: ns_clients.hpp:525
string m_ClientHost
Definition: ns_clients.hpp:538
void RemovePreferredAffinity(unsigned int aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:462
CNSClient(CNSClient &&)=default
void AddBlacklistedJobs(ECommandGroup cmd_group, TNSBitVector &bv) const
Definition: ns_clients.hpp:337
CNSPreciseTime GetLastAccess(void) const
Definition: ns_clients.hpp:358
SRemoteNodeData m_WNData
Definition: ns_clients.hpp:554
string GetVirtualScope(const string &client_node) const
Definition: ns_clients.cpp:919
CNSClient & operator=(const CNSClient &)=default
@ eWNAndReaderStale
Definition: ns_clients.hpp:309
void SetClaimedType(EClaimedClientType new_type)
Definition: ns_clients.hpp:499
CNSPreciseTime m_SessionResetTime
Definition: ns_clients.hpp:542
void Touch(const CNSClientId &client_id)
Definition: ns_clients.cpp:655
unsigned int m_Addr
Definition: ns_clients.hpp:536
void GCBlacklistedJobs(const CJobStatusTracker &tracker, ECommandGroup cmd_group)
Definition: ns_clients.cpp:886
void MarkAsAdmin(void)
Definition: ns_clients.hpp:371
string x_TypeAsString(void) const
Definition: ns_clients.cpp:925
bool IsRequestedAffinity(const TNSBitVector &aff, bool use_preferred, ECommandGroup cmd_group) const
Definition: ns_clients.hpp:486
bool HasPreferredAffinities(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:407
void SetLastScope(const string &scope)
Definition: ns_clients.hpp:518
void SetSession(const string &new_session)
Definition: ns_clients.hpp:353
unsigned int m_Type
Definition: ns_clients.hpp:527
size_t m_NumberOfSubmitted
Definition: ns_clients.hpp:548
SRemoteNodeData m_ReaderData
Definition: ns_clients.hpp:555
void AppendType(unsigned int type_to_append)
Definition: ns_clients.hpp:383
void SetPreferredAffinities(const TNSBitVector &aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:470
TNSBitVector GetPreferredAffinities(ECommandGroup cmd_group) const
Definition: ns_clients.hpp:400
void RemovePreferredAffinities(const TNSBitVector &aff, ECommandGroup cmd_group)
Definition: ns_clients.hpp:454
void RegisterSocketWriteError(void)
Definition: ns_clients.hpp:361
string x_StateAsString(void) const
Definition: ns_clients.cpp:969
static CNSPreciseTime Current(void)
NetScheduler threaded server.
Definition: ns_server.hpp:57
Bitvector Bit-vector container with runtime compression of bits.
Definition: bm.h:115
bool any() const noexcept
Returns true if any bits in this bitset are set, and otherwise returns false.
Definition: bm.h:2451
bool set_bit(size_type n, bool val=true)
Sets bit n.
Definition: bm.h:4227
void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
clear list of bits in this bitset
Definition: bm.h:4149
bool empty() const
Definition: map.hpp:149
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
#define check(s)
Definition: describecol2.c:21
char data[12]
Definition: iconv.c:80
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
unsigned int TNSCommandChecks
Definition: ns_access.hpp:50
@ eNS_Admin
Definition: ns_access.hpp:43
EClaimedClientType
Definition: ns_clients.hpp:55
@ eClaimedWorkerNode
Definition: ns_clients.hpp:57
@ eClaimedAdmin
Definition: ns_clients.hpp:59
@ eClaimedNotProvided
Definition: ns_clients.hpp:64
@ eClaimedReader
Definition: ns_clients.hpp:58
@ eClaimedReset
Definition: ns_clients.hpp:62
@ eClaimedAutodetect
Definition: ns_clients.hpp:60
@ eClaimedSubmitter
Definition: ns_clients.hpp:56
ECommandGroup
Definition: ns_types.hpp:54
@ eGet
Definition: ns_types.hpp:55
true_type verbose
Definition: processing.cpp:890
void AddToBlacklist(unsigned int job_id, const CNSPreciseTime &last_access)
Definition: ns_clients.cpp:382
void ClearJobs(void)
Definition: ns_clients.hpp:201
void x_BlacklistedOp(void) const
Definition: ns_clients.cpp:535
TNSBitVector m_WaitAffinities
Definition: ns_clients.hpp:264
void AddPreferredAffinities(const TNSBitVector &aff)
Definition: ns_clients.hpp:205
TNSBitVector m_Jobs
Definition: ns_clients.hpp:249
map< unsigned int, CNSPreciseTime > m_BlacklistLimits
Definition: ns_clients.hpp:256
size_t m_JobsOpCount
Definition: ns_clients.hpp:267
CNSPreciseTime * m_BlacklistTimeout
Definition: ns_clients.hpp:253
void x_UpdateBlacklist(void) const
Definition: ns_clients.cpp:330
void GCBlacklist(const CJobStatusTracker &tracker, const vector< TJobStatus > &match_states)
Definition: ns_clients.cpp:477
void SetWaitAffinities(const TNSBitVector &aff)
Definition: ns_clients.hpp:222
void SubtractBlacklistedJobs(TNSBitVector &bv) const
Definition: ns_clients.hpp:187
unsigned short m_WaitPort
Definition: ns_clients.hpp:259
size_t m_NumberOfGiven
Definition: ns_clients.hpp:246
size_t m_WaitAffinitiesOpCount
Definition: ns_clients.hpp:270
void CancelWaiting(void)
Definition: ns_clients.cpp:518
void AddBlacklistedJobs(TNSBitVector &bv) const
Definition: ns_clients.hpp:194
TNSBitVector m_BlacklistedJobs
Definition: ns_clients.hpp:252
const TNSBitVector & GetBlacklistedJobsRef(void) const
Definition: ns_clients.hpp:183
TNSBitVector m_PrefAffinities
Definition: ns_clients.hpp:263
void UpdateBlacklist(unsigned int job_id) const
Definition: ns_clients.cpp:351
void x_JobsOp(void) const
Definition: ns_clients.cpp:527
bool ClearPreferredAffinities(void)
Definition: ns_clients.cpp:406
void RemovePreferredAffinities(const TNSBitVector &aff)
Definition: ns_clients.hpp:209
void RegisterJob(unsigned int job_id)
Definition: ns_clients.cpp:417
void x_PrefAffinitiesOp(void) const
Definition: ns_clients.cpp:543
void x_ClearPreferredAffinities(void)
Definition: ns_clients.hpp:273
void ClearWaitAffinities(void)
Definition: ns_clients.hpp:226
size_t m_BlacklistedJobsOpCount
Definition: ns_clients.hpp:268
void RemovePreferredAffinity(unsigned int aff)
Definition: ns_clients.hpp:213
void x_WaitAffinitiesOp(void) const
Definition: ns_clients.cpp:551
bool AddPreferredAffinity(unsigned int aff)
Definition: ns_clients.cpp:446
size_t m_PrefAffinitiesOpCount
Definition: ns_clients.hpp:269
bool MoveJobToBlacklist(unsigned int job_id)
Definition: ns_clients.cpp:434
void SetPreferredAffinities(const TNSBitVector &aff)
Definition: ns_clients.hpp:217
string GetBlacklistLimit(unsigned int job_id) const
Definition: ns_clients.cpp:372
bool IsRequestedAffinity(const TNSBitVector &aff, bool use_preferred) const
Definition: ns_clients.cpp:462
void UnregisterGivenJob(unsigned int job_id)
Definition: ns_clients.cpp:426
Modified on Sat May 25 14:16:34 2024 by modify_doxy.py rev. 669887