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

Go to the SVN repository for this file.

1 #ifndef NETSCHEDULE_ROLLBACK__HPP
2 #define NETSCHEDULE_ROLLBACK__HPP
3 
4 /* $Id: ns_rollback.hpp 66722 2015-03-20 13:56:42Z 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 limited rollback support
33  *
34  */
35 
36 
37 #include "ns_clients.hpp"
38 #include "ns_precise_time.hpp"
39 
40 
42 
43 // Forward declaration
44 class CQueue;
45 
46 
48 {
49  public:
50  virtual void Rollback(CQueue * queue) = 0;
51  virtual ~CNSRollbackInterface() {}
52 };
53 
54 
55 
57 {
58  public:
60  unsigned int job_id,
61  const CNSPreciseTime & op_begin,
62  const CNSPreciseTime & written_to_db) :
63  m_Client(client), m_JobId(job_id),
64  m_OpBegin(op_begin), m_WrittenToDB(written_to_db)
65  {}
66 
67  virtual ~CNSSubmitRollback() {}
68 
69  public:
70  virtual void Rollback(CQueue * queue);
71 
72  private:
74  unsigned int m_JobId;
77 };
78 
79 
80 
82 {
83  public:
85  unsigned int first_job_id,
86  size_t batch_size) :
88  m_FirstJobId(first_job_id), m_BatchSize(batch_size)
89  {}
90 
92 
93  public:
94  virtual void Rollback(CQueue * queue);
95 
96  private:
98  unsigned int m_FirstJobId;
99  size_t m_BatchSize;
100 };
101 
102 
103 
105 {
106  public:
108  unsigned int job_id) :
109  m_Client(client), m_JobId(job_id)
110  {}
111 
112  virtual ~CNSGetJobRollback() {}
113 
114  public:
115  virtual void Rollback(CQueue * queue);
116 
117  private:
119  unsigned int m_JobId;
120 };
121 
122 
124 {
125  public:
127  unsigned int job_id,
128  TJobStatus previous_status) :
129  m_Client(client), m_JobId(job_id),
130  m_PreviousStatus(previous_status)
131  {}
132 
133  virtual ~CNSReadJobRollback() {}
134 
135  public:
136  virtual void Rollback(CQueue * queue);
137 
138  private:
140  unsigned int m_JobId;
142 };
143 
144 
145 
147 
148 #endif /* NETSCHEDULE_ROLLBACK__HPP */
149 
unsigned int m_FirstJobId
Definition: ns_rollback.hpp:98
virtual void Rollback(CQueue *queue)
Definition: ns_rollback.cpp:68
CNSBatchSubmitRollback(const CNSClientId &client, unsigned int first_job_id, size_t batch_size)
Definition: ns_rollback.hpp:84
virtual ~CNSBatchSubmitRollback()
Definition: ns_rollback.hpp:91
CNSGetJobRollback(const CNSClientId &client, unsigned int job_id)
virtual void Rollback(CQueue *queue)
Definition: ns_rollback.cpp:89
CNSClientId m_Client
virtual ~CNSGetJobRollback()
unsigned int m_JobId
virtual ~CNSReadJobRollback()
TJobStatus m_PreviousStatus
virtual void Rollback(CQueue *queue)
CNSClientId m_Client
unsigned int m_JobId
CNSReadJobRollback(const CNSClientId &client, unsigned int job_id, TJobStatus previous_status)
virtual void Rollback(CQueue *queue)=0
virtual ~CNSRollbackInterface()
Definition: ns_rollback.hpp:51
CNSPreciseTime m_OpBegin
Definition: ns_rollback.hpp:75
unsigned int m_JobId
Definition: ns_rollback.hpp:74
CNSPreciseTime m_WrittenToDB
Definition: ns_rollback.hpp:76
CNSClientId m_Client
Definition: ns_rollback.hpp:73
virtual ~CNSSubmitRollback()
Definition: ns_rollback.hpp:67
virtual void Rollback(CQueue *queue)
Definition: ns_rollback.cpp:43
CNSSubmitRollback(const CNSClientId &client, unsigned int job_id, const CNSPreciseTime &op_begin, const CNSPreciseTime &written_to_db)
Definition: ns_rollback.hpp:59
EJobStatus
Job status codes.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static CNamedPipeClient * client
Modified on Fri Sep 20 14:57:42 2024 by modify_doxy.py rev. 669887