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
CatalogStandardNodeMetadata.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  * CatalogStandardNodeMetadata.h
20  *
21  */
22 
23 #ifndef SRC_CATALOG_CATALOGSTANDARDNODEMETADATA_H_
24 #define SRC_CATALOG_CATALOGSTANDARDNODEMETADATA_H_
25 
26 #include "CatalogNodeMetadata.h"
27 #include <iostream>
28 #include <string>
29 
30 using namespace std;
31 
32 // This class serves to store information about a node in a cluster of PDB.
33 // It also provides methods for maintaining their associated metadata.
34 // Clients of this class will access this information using a handler to the
35 // catalog.
36 
38 public:
40 
41  CatalogStandardNodeMetadata(string nodeIdValue, string nodeIPValue,
42  int nodePortValue, string nodeNameValue,
43  string nodeTypeValue, int nodeStatusValue);
44 
45  // Copy constructor
47 
49 
50  void setValues(string nodeIdValue, string nodeIPValue, int nodePortValue,
51  string nodeNameValue, string nodeTypeValue,
52  int nodeStatusValue);
53 
54  string getItemKey();
55 
56  string getNodeIP();
57 
58  string getItemId();
59 
60  string getItemName();
61 
62  string getNodeType();
63 
64  int getNodePort();
65 
66  int getNodeStatus();
67 
68  void setItemKey(string &itemKeyIn);
69 
70  void setItemIP(pdb::String &itemIPIn);
71 
72  void setItemId(string &itemIdIn);
73 
74  void setItemName(string &itemNameIn);
75 
76  void setNodePort(int &portIn);
77 
78  string printShort();
79 
80  void toStandardMetadata(pdb::Handle<pdb::CatalogNodeMetadata> &convertedItem);
81 
82  friend std::ostream &operator<<(std::ostream &out,
84  out << "\nCluster Node Metadata" << endl;
85  out << "-------------------" << endl;
86  out << " Node Id: " << node.getItemId().c_str() << endl;
87  out << " Node IP: " << node.getNodeIP().c_str() << endl;
88  out << " Node Port: " << node.getNodePort() << endl;
89  out << " Node Name: " << node.getItemName().c_str() << endl;
90  out << " Node Type: " << node.getNodeType().c_str() << endl;
91  out << "-------------------\n" << endl;
92  return out;
93  }
94 
95 private:
96  string nodeId;
97  string nodeIP;
98  int nodePort;
99  string nodeName;
100  string nodeType;
102  string nodeAddress;
103 };
104 
105 #endif /* SRC_CATALOG_CATALOGSTANDARDNODEMETADATA_H_ */
friend std::ostream & operator<<(std::ostream &out, CatalogStandardNodeMetadata &node)