forked from dase/CLAIMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnvironment.h
executable file
·71 lines (67 loc) · 2 KB
/
Environment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Environment.h
*
* Created on: Aug 10, 2013
* Author: wangli
*/
#ifndef ENVIRONMENT_H_
#define ENVIRONMENT_H_
#include "AdaptiveEndPoint.h"
#include "Executor/Coordinator.h"
#include "Executor/IteratorExecutorMaster.h"
#include "Executor/IteratorExecutorSlave.h"
#include "Executor/ExchangeTracker.h"
#include "PortManager.h"
#include "Logging.h"
#include "storage/BlockManager.h"
#include "storage/BlockManagerMaster.h"
#include "Resource/ResourceManagerMaster.h"
#include "Resource/ResourceManagerSlave.h"
#include "Catalog/Catalog.h"
#include "BufferManager/BufferManager.h"
class Environment {
public:
virtual ~Environment();
static Environment* getInstance(bool ismaster=0);
std::string getIp();
unsigned getPort();
AdaptiveEndPoint* getEndPoint();
ExchangeTracker* getExchangeTracker();
ResourceManagerMaster* getResourceManagerMaster();
ResourceManagerSlave* getResourceManagerSlave();
NodeID getNodeID()const;
Catalog* getCatalog()const;
Environment(bool ismaster=false);
private:
void Initialize();
void InitializeEndPoint();
void InitializeCoordinator();
void InitializeStorage();
void InitializeResourceManager();
void InitializeBufferManager();
private:
static Environment* _instance;
PortManager* portManager;
AdaptiveEndPoint* endpoint;
Coordinator* coordinator;
std::string ip;
unsigned port;
IteratorExecutorSlave* iteratorExecutorSlave;
IteratorExecutorMaster* iteratorExecutorMaster;
ExchangeTracker* exchangeTracker;
Logging* logging_;
bool ismaster_;
ResourceManagerMaster* resourceManagerMaster_;
ResourceManagerSlave* resourceManagerSlave_;
Catalog* catalog_;
/* the globally unique node id*/
NodeID nodeid;
BlockManagerMaster* blockManagerMaster_;
BlockManager* blockManager_;
BufferManager* bufferManager_;
/**
* TODO: the master and slave pair, such as ResouceManagerMaster and ResourceManagerSlave, should have a
* base class which provides the access methods and is derived by ResouceManagerMaster and ResourceManagerSlave.
*/
};
#endif /* ENVIRONMENT_H_ */