]> git.uio.no Git - u/mrichter/AliRoot.git/blob - SHUTTLE/AliShuttleStatus.cxx
automatic histogram scaling for AODs now available
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleStatus.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.4  2006/10/02 16:38:39  jgrosseo
19 update (alberto):
20 fixed memory leaks
21 storing of objects that failed to be stored to the grid before
22 interfacing of shuttle status table in daq system
23
24 Revision 1.3  2006/08/29 09:16:05  jgrosseo
25 small update
26
27 Revision 1.2  2006/08/15 10:50:00  jgrosseo
28 effc++ corrections (alberto)
29
30 Revision 1.1  2006/07/20 13:20:13  jgrosseo
31 introducing status management: The processing per subdetector is divided into several steps,
32 after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
33 can keep track of the number of failures and skips further processing after a certain threshold is
34 exceeded. These thresholds can be configured in LDAP.
35
36 */
37
38 //
39 // This class stores the status of the Shuttle processing for a given run and a given detector
40 //
41 // This class stores the status of the processing, the number of retries and the timestamp of the last action
42 // The detector and run number are stored using the CDB framework
43 //
44 //
45
46 #include "AliShuttleStatus.h"
47
48 ClassImp(AliShuttleStatus)
49
50 //______________________________________________________________________________________________
51 AliShuttleStatus::AliShuttleStatus() : TObject(),
52   fTimeStamp(0),
53   fStatus(kInvalid),
54   fCount(0)
55 {
56   // default constructor
57 }
58
59 //______________________________________________________________________________________________
60 AliShuttleStatus::AliShuttleStatus(Status status) : TObject(),
61   fTimeStamp(0),
62   fStatus(status),
63   fCount(1)
64 {
65   // constructor
66
67   fTimeStamp = time(0);
68 }
69
70 //______________________________________________________________________________________________
71 AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
72 TObject(c),  fTimeStamp(0),
73 fStatus(kInvalid),
74 fCount(1)
75 {
76   // copy constructor
77
78   ((AliShuttleStatus &)c).Copy(*this);
79 }
80
81 //______________________________________________________________________________________________
82 AliShuttleStatus::~AliShuttleStatus()
83 {
84   // destructor
85 }
86
87 //______________________________________________________________________________________________
88 AliShuttleStatus &AliShuttleStatus::operator=(const AliShuttleStatus &c)
89 {
90   // assigment operator
91
92   if (this != &c) 
93     ((AliShuttleStatus &) c).Copy(*this);
94
95   return *this;
96 }
97
98 //______________________________________________________________________________________________
99 void AliShuttleStatus::Copy(TObject& c) const
100 {
101   // copy function
102
103   AliShuttleStatus& target = (AliShuttleStatus &) c;
104
105   target.fTimeStamp = fTimeStamp;
106   target.fStatus = fStatus;
107   target.fCount = fCount;
108 }
109
110 //______________________________________________________________________________________________
111 void AliShuttleStatus::SetStatus(Status status)
112 {
113   // sets a new status, add the same time the timestamp is set to now
114
115   fStatus = status;
116   fTimeStamp = time(0);
117 }
118
119 //______________________________________________________________________________________________
120 const char* AliShuttleStatus::GetStatusName(Status status)
121 {
122   // returns a name (string) of the status
123
124   switch (status)
125   {
126     case kInvalid: return "Invalid";
127     case kStarted: return "Started";
128     case kDCSStarted: return "DCSStarted";
129     case kDCSError: return "DCSError";
130     case kPPStarted: return "PPStarted";
131     case kPPTimeOut: return "PPTimeOut";
132     case kPPOutOfMemory: return "PPOutOfMemory";
133     case kPPError: return "PPError";
134     case kPPDone: return "PPDone";
135     case kStoreStarted: return "StoreStarted";
136     case kStoreError: return "StoreError";
137     case kDone: return "Done";
138     case kFailed: return "Failed";
139     case kStoreDelayed: return "StoreDelayed";
140     case kFXSError: return "FXSError";
141     case kSkipped: return "Skipped";
142   }
143
144   return 0;
145 }