ARC SDK
Processor.h
1 #ifndef PROCESSOR_H_
2 #define PROCESSOR_H_
3 
4 #include <arc/Logger.h>
5 
6 #include "DTR.h"
7 
8 namespace DataStaging {
9 
11 
18  class Processor: public DTRCallback {
19 
20  private:
21 
23  Processor(const Processor&);
25  Processor& operator=(const Processor&);
26 
28  class ThreadArgument {
29  public:
30  Processor* proc;
31  DTR_ptr dtr;
32  ThreadArgument(Processor* proc_, DTR_ptr dtr_):proc(proc_),dtr(dtr_) { };
33  };
34 
36  class BulkThreadArgument {
37  public:
38  Processor* proc;
39  std::list<DTR_ptr> dtrs;
40  BulkThreadArgument(Processor* proc_, const std::list<DTR_ptr>& dtrs_):proc(proc_),dtrs(dtrs_) { };
41  };
42 
44  Arc::SimpleCounter thread_count;
45 
50  std::list<DTR_ptr> bulk_list;
51 
53  static std::string hostname;
54 
55  /* Thread methods which deal with each state */
57  static void DTRCheckCache(void* arg);
59  static void DTRResolve(void* arg);
61  static void DTRBulkResolve(void* arg);
63  static void DTRQueryReplica(void* arg);
65  static void DTRBulkQueryReplica(void* arg);
67  static void DTRPreClean(void *arg);
69  static void DTRStagePrepare(void* arg);
71  static void DTRReleaseRequest(void* arg);
73  static void DTRRegisterReplica(void* arg);
75  static void DTRProcessCache(void* arg);
76 
77  public:
78 
80  Processor();
82  ~Processor() { stop(); };
83 
85 
90  void start(void);
91 
93 
97  void stop(void);
98 
100 
107  virtual void receiveDTR(DTR_ptr dtr);
108  };
109 
110 
111 } // namespace DataStaging
112 
113 
114 #endif /* PROCESSOR_H_ */
The base class from which all callback-enabled classes should be derived.
Definition: DTR.h:193
Processor()
Constructor.
Thread-safe counter with capability to wait for zero value.
Definition: Thread.h:244
The Processor performs pre- and post-transfer operations.
Definition: Processor.h:18
void start(void)
Start Processor.
virtual void receiveDTR(DTR_ptr dtr)
Send a DTR to the Processor.
void stop(void)
Stop Processor.
DataStaging contains all components for data transfer scheduling and execution.
Definition: DataDelivery.h:12
~Processor()
Destructor waits for all active threads to stop.
Definition: Processor.h:82