A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NodeInfo.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * Copyright 2018 Rice University *
4  * *
5  * Licensed under the Apache License, Version 2.0 (the "License"); *
6  * you may not use this file except in compliance with the License. *
7  * You may obtain a copy of the License at *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14  * See the License for the specific language governing permissions and *
15  * limitations under the License. *
16  * *
17  *****************************************************************************/
18 /*
19  * NodeInfo.h
20  *
21  * Created on: Mar 7, 2016
22  * Author: Kia
23  */
24 
25 #ifndef NODE_INFO_H
26 #define NODE_INFO_H
27 
28 #include "Object.h"
29 #include "Handle.h"
30 #include "PDBString.h"
31 
32 // PRELOAD %NodeInfo%
33 
34 namespace pdb {
35 
41 class NodeInfo : public Object {
42 
43 public:
44  NodeInfo() {}
45 
46  ~NodeInfo() {}
47 
48  // CPU load might be used later to know how a processing node is overloaded with tasks.
49  int getCpuLoad() {
50  return cpuLoad;
51  }
52 
53  void setCpuLoad(int cpuLoad) {
54  this->cpuLoad = cpuLoad;
55  }
56 
58  return hostName;
59  }
60 
62  this->hostName = hostName;
63  }
64 
65  int getPort() {
66  return port;
67  }
68 
69  void setPort(int port) {
70  this->port = port;
71  }
72 
74 
75 private:
76  // hostname or IP address of the PDB server
78  // port number on which the PDB server is running
79  int port;
80 
81  // current cpu load of the server as an integer between 0-100, 100 means %100 CPU load.
82  int cpuLoad;
83 };
84 }
85 
86 #endif
#define ENABLE_DEEP_COPY
Definition: DeepCopy.h:52
int getCpuLoad()
Definition: NodeInfo.h:49
String & getHostName()
Definition: NodeInfo.h:57
void setCpuLoad(int cpuLoad)
Definition: NodeInfo.h:53
String hostName
Definition: NodeInfo.h:77
void setPort(int port)
Definition: NodeInfo.h:69
void setHostName(pdb::String &hostName)
Definition: NodeInfo.h:61
int getPort()
Definition: NodeInfo.h:65