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.cc
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.cc
20  *
21  */
22 
24 
25 using namespace std;
26 
28 
30  string nodeIdValue, string nodeIPValue, int nodePortValue,
31  string nodeNameValue, string nodeTypeValue, int nodeStatusValue)
32  : nodeId(nodeIdValue), nodeIP(nodeIPValue), nodePort(nodePortValue),
33  nodeName(nodeNameValue), nodeType(nodeTypeValue),
34  nodeStatus(nodeStatusValue) {
35  nodeAddress =
36  std::string(nodeIP) + std::string(":") + std::to_string(nodePort);
37 }
38 
39 // Copy constructor
41  const CatalogStandardNodeMetadata &pdbNodeToCopy) {
42  nodeId = pdbNodeToCopy.nodeId;
43  nodeIP = pdbNodeToCopy.nodeIP;
44  nodePort = pdbNodeToCopy.nodePort;
45  nodeName = pdbNodeToCopy.nodeName;
46  nodeType = pdbNodeToCopy.nodeType;
47  nodeStatus = pdbNodeToCopy.nodeStatus;
48  nodeAddress =
49  std::string(nodeIP) + std::string(":") + std::to_string(nodePort);
50 }
51 
53 
55  string nodeIdValue, string nodeIPValue, int nodePortValue,
56  string nodeNameValue, string nodeTypeValue, int nodeStatusValue) {
57  nodeId = nodeIPValue;
58  nodeIP = nodeIPValue;
59  nodePort = nodePortValue;
60  nodeName = nodeNameValue;
61  nodeType = nodeTypeValue;
62  nodeStatus = nodeStatusValue;
63  nodeAddress =
64  std::string(nodeIP) + std::string(":") + std::to_string(nodePort);
65 }
66 
68 
70 
72 
74 
76 
78 
80 
81 void CatalogStandardNodeMetadata::setItemKey(string &itemKeyIn) {
82  nodeAddress = itemKeyIn;
83 }
84 
86  nodeId = itemIdIn;
87 }
88 
90  nodeIP = itemIPIn;
91 }
92 
93 void CatalogStandardNodeMetadata::setItemName(string &itemNameIn) {
94  nodeName = itemNameIn;
95 }
96 
98  nodePort = portIn;
99 }
100 
102  string output;
103  output = " Node address: ";
104  output.append(getNodeIP().c_str())
105  .append(" | ")
106  .append(getItemName().c_str())
107  .append(" | ")
108  .append(getNodeType().c_str());
109  return output;
110 }
111 
113  pdb::Handle<pdb::CatalogNodeMetadata> &convertedItem) {
114  // convertedItem->setValues();
115 }
void setItemIP(pdb::String &itemIPIn)
void setValues(string nodeIdValue, string nodeIPValue, int nodePortValue, string nodeNameValue, string nodeTypeValue, int nodeStatusValue)
void toStandardMetadata(pdb::Handle< pdb::CatalogNodeMetadata > &convertedItem)