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

Go to the SVN repository for this file.

1 #ifndef NETSCHEDULE_NS_TYPES__HPP
2 #define NETSCHEDULE_NS_TYPES__HPP
3 
4 /* $Id: ns_types.hpp 93717 2021-05-14 17:29:38Z 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: Victor Joukov
30  *
31  * File Description:
32  * NetSchedule common types and various string constants
33  *
34  */
35 
36 
37 #include <string>
38 
41 #include <util/bitset/bmalgo.h>
42 
44 
45 #include "ns_queue_parameters.hpp"
46 
47 
49 
50 // Distinguishes get and read for various situations:
51 // - notifications
52 // - affinities
53 // etc
55  eGet, // Comes from a worker node
56  eRead, // Comes from a reader
57  eUndefined // Comes from neither a wn nor a reader
58 };
59 
60 
61 // Submitter/listener notification reasons
63  eStatusChanged, // Job status has been changed
64  eNotificationStolen, // Listener notification has been stolen
65  eProgressMessageChanged, // The progress message has been changed
66  eJobDeleted // The job has been deleted from the DB
67 };
68 
69 
72 
73 // Holds all the queue parameters - used for queue classes
74 // and for reading from DB and ini files
76 
77 
78 
79 const string kDumpSubdirName("dump");
80 const string kDumpReservedSpaceFileName("space_keeper.dat");
81 const string kQClassDescriptionFileName("qclass_descr.dump");
82 const string kLinkedSectionsFileName("linked_sections.dump");
83 const string kJobsFileName("jobs.dump");
84 const string kDBStorageVersionFileName("DB_STORAGE_VER");
85 const string kStartJobIDsFileName("STARTJOBIDS");
86 const string kNodeIDFileName("NODE_ID");
87 const string kCrashFlagFileName("CRASH_FLAG");
88 const string kDumpErrorFlagFileName("DUMP_ERROR_FLAG");
89 const string kPausedQueuesFilesName("PAUSED_QUEUES");
90 const string kRefuseSubmitFileName("REFUSE_SUBMIT");
91 const size_t kDumpReservedSpaceFileBuffer = 1024 * 1024;
92 
93 static string kNewLine("\n");
94 
95 
96 // Various hex viewers show this magic in a different way.
97 // Some swap first two bytes with the last two bytes
98 // Some reverse the signature byte by byte. So the magic is selected to be
99 // visible the same way everywhere.
100 // See kOldDumpMagic as well in ns_db_dump.cpp
101 const Uint4 kDumpMagic(0xF0F0F0F0);
102 
103 
104 // An empty bit vector is returned in quite a few places
106 
107 // A few limits
108 const unsigned kMaxQueueNameSize = 64;
109 const unsigned kMaxHitIdSize = 128; // 64 -> 128 See CXX-11914
110 const unsigned kMaxClientIpSize = 48; // 64 -> 48 See CXX-3449
111 const unsigned kMaxSessionIdSize = 48; // 64 -> 48 See CXX-3449
112 const unsigned kLinkedSectionValueNameSize = 8192;
113 const unsigned kLinkedSectionValueSize = 8192;
114 const unsigned kLinkedSectionsList = 8192;
115 const unsigned kMaxQueueLimitsSize = 16 * 1024;
116 const unsigned kMaxDescriptionSize = 16 * 1024;
117 const unsigned kMaxWorkerNodeIdSize = 64;
118 const unsigned kNetScheduleMaxOverflowSize = 1024 * 1024;
119 
120 
122 
123 #endif /* NETSCHEDULE_NS_TYPES__HPP */
124 
Algorithms for bvector<> (main include)
EJobStatus
Job status codes.
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Compressed bitset (entry point to bm.h)
Bitset allocator.
NetSchedule client specs.
const TNSBitVector kEmptyBitVector
Definition: ns_types.hpp:105
const unsigned kMaxHitIdSize
Definition: ns_types.hpp:109
ENotificationReason
Definition: ns_types.hpp:62
@ eProgressMessageChanged
Definition: ns_types.hpp:65
@ eJobDeleted
Definition: ns_types.hpp:66
@ eStatusChanged
Definition: ns_types.hpp:63
@ eNotificationStolen
Definition: ns_types.hpp:64
bm::bvector TNSBitVector
Definition: ns_types.hpp:70
const unsigned kLinkedSectionsList
Definition: ns_types.hpp:114
const string kPausedQueuesFilesName("PAUSED_QUEUES")
const unsigned kMaxWorkerNodeIdSize
Definition: ns_types.hpp:117
const string kDumpReservedSpaceFileName("space_keeper.dat")
const string kCrashFlagFileName("CRASH_FLAG")
const unsigned kLinkedSectionValueSize
Definition: ns_types.hpp:113
const string kDBStorageVersionFileName("DB_STORAGE_VER")
const string kLinkedSectionsFileName("linked_sections.dump")
ECommandGroup
Definition: ns_types.hpp:54
@ eUndefined
Definition: ns_types.hpp:57
@ eGet
Definition: ns_types.hpp:55
@ eRead
Definition: ns_types.hpp:56
const unsigned kLinkedSectionValueNameSize
Definition: ns_types.hpp:112
const size_t kDumpReservedSpaceFileBuffer
Definition: ns_types.hpp:91
const string kDumpErrorFlagFileName("DUMP_ERROR_FLAG")
const unsigned kMaxSessionIdSize
Definition: ns_types.hpp:111
const string kJobsFileName("jobs.dump")
const unsigned kMaxDescriptionSize
Definition: ns_types.hpp:116
static string kNewLine("\n")
const string kDumpSubdirName("dump")
map< string, SQueueParameters, PNocase > TQueueParams
Definition: ns_types.hpp:75
const unsigned kMaxClientIpSize
Definition: ns_types.hpp:110
const Uint4 kDumpMagic(0xF0F0F0F0)
const string kNodeIDFileName("NODE_ID")
const string kRefuseSubmitFileName("REFUSE_SUBMIT")
const unsigned kNetScheduleMaxOverflowSize
Definition: ns_types.hpp:118
const unsigned kMaxQueueLimitsSize
Definition: ns_types.hpp:115
const string kStartJobIDsFileName("STARTJOBIDS")
const string kQClassDescriptionFileName("qclass_descr.dump")
const unsigned kMaxQueueNameSize
Definition: ns_types.hpp:108
CNetScheduleAPI::EJobStatus TJobStatus
Definition: ns_types.hpp:71
Modified on Fri Sep 20 14:57:12 2024 by modify_doxy.py rev. 669887