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.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
NodeDispatcherData.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
// Created by Joseph Hwang on 9/13/16.
20
//
21
22
#ifndef OBJECTQUERYMODEL_NODEDISPATCHERDATA_H
23
#define OBJECTQUERYMODEL_NODEDISPATCHERDATA_H
24
25
#include "
Object.h
"
26
#include "
PDBString.h
"
27
#include "
PDBVector.h
"
28
#include "
DataTypes.h
"
29
//#include "SetInfo.h"
30
31
#include <string>
32
33
// PRELOAD %NodeDispatcherData%
34
35
namespace
pdb {
36
37
class
NodeDispatcherData
:
public
Object
{
38
39
public
:
40
ENABLE_DEEP_COPY
41
42
NodeDispatcherData
() {}
43
~NodeDispatcherData
() {}
44
45
NodeDispatcherData
(
NodeID
nodeId
,
int
port
, std::string
address
) {
46
this->nodeId =
nodeId
;
47
this->port =
port
;
48
this->address =
address
;
49
this->
totalBytesSent
= 0;
50
this->
totalBytesStored
= 0;
51
}
52
53
NodeID
getNodeId
() {
54
return
this->
nodeId
;
55
}
56
57
int
getPort
()
const
{
58
return
this->
port
;
59
}
60
61
String
getAddress
()
const
{
62
return
this->
address
;
63
}
64
65
size_t
getBytesSentToSet
()
const
{
66
return
0;
67
}
68
69
/*
70
void addSet(std::string set, std::string database, long typeId) {
71
sets.push_back(pdb::makeObject<pdb::SetInfo> (set, database, typeId));
72
bytesSent.push_back(0);
73
}
74
*/
75
76
bool
operator==
(
const
NodeDispatcherData
& other) {
77
return
this->
port
== other.
getPort
() && this->
address
== other.
getAddress
();
78
}
79
80
std::string
toString
() {
81
return
std::to_string(this->
port
) +
":"
+
static_cast<
std::string
>
(this->
address
);
82
}
83
84
private
:
85
NodeID
nodeId
;
86
int
port
;
87
String
address
;
88
89
// TODO: Replace this with map when possible. Provides a mapping between a set and the number of
90
// bytes sent to it.
91
// Vector<Handle<SetInfo>> sets;
92
93
// JOSEPH: These bottom values will only be available to the dispatcher
94
Vector<size_t>
bytesSent
;
95
Vector<size_t>
bytesStored
;
96
97
size_t
totalBytesSent
;
98
size_t
totalBytesStored
;
99
100
// TODO: Add database and set information
101
};
102
}
103
104
105
#endif // OBJECTQUERYMODEL_NODEDISPATCHERDATA_H
ENABLE_DEEP_COPY
#define ENABLE_DEEP_COPY
Definition:
DeepCopy.h:52
pdb::NodeDispatcherData::nodeId
NodeID nodeId
Definition:
NodeDispatcherData.h:85
pdb::NodeDispatcherData::bytesStored
Vector< size_t > bytesStored
Definition:
NodeDispatcherData.h:95
pdb::NodeDispatcherData::operator==
bool operator==(const NodeDispatcherData &other)
Definition:
NodeDispatcherData.h:76
pdb::NodeDispatcherData::getPort
int getPort() const
Definition:
NodeDispatcherData.h:57
pdb::NodeDispatcherData::totalBytesSent
size_t totalBytesSent
Definition:
NodeDispatcherData.h:97
pdb::Object
Definition:
Object.h:42
PDBString.h
pdb::NodeDispatcherData
Definition:
NodeDispatcherData.h:37
NodeID
unsigned int NodeID
Definition:
DataTypes.h:27
pdb::NodeDispatcherData::getAddress
String getAddress() const
Definition:
NodeDispatcherData.h:61
pdb::NodeDispatcherData::NodeDispatcherData
NodeDispatcherData(NodeID nodeId, int port, std::string address)
Definition:
NodeDispatcherData.h:45
pdb::NodeDispatcherData::NodeDispatcherData
ENABLE_DEEP_COPY NodeDispatcherData()
Definition:
NodeDispatcherData.h:42
pdb::NodeDispatcherData::getBytesSentToSet
size_t getBytesSentToSet() const
Definition:
NodeDispatcherData.h:65
pdb::String
Definition:
PDBString.h:43
DataTypes.h
pdb::NodeDispatcherData::getNodeId
NodeID getNodeId()
Definition:
NodeDispatcherData.h:53
pdb::Vector< size_t >
PDBVector.h
pdb::NodeDispatcherData::bytesSent
Vector< size_t > bytesSent
Definition:
NodeDispatcherData.h:94
pdb::NodeDispatcherData::toString
std::string toString()
Definition:
NodeDispatcherData.h:80
Object.h
pdb::NodeDispatcherData::address
String address
Definition:
NodeDispatcherData.h:87
pdb::NodeDispatcherData::port
int port
Definition:
NodeDispatcherData.h:86
pdb::NodeDispatcherData::totalBytesStored
size_t totalBytesStored
Definition:
NodeDispatcherData.h:98
pdb::NodeDispatcherData::~NodeDispatcherData
~NodeDispatcherData()
Definition:
NodeDispatcherData.h:43
plinycompute
pdb
src
builtInPDBObjects
headers
NodeDispatcherData.h
Generated on Mon Jun 18 2018 18:10:35 by
1.8.6