25 #include <sys/types.h>
32 #include "BuiltInObjectTypeIDs.h"
69 std::string hostname = request->getHostName();
73 bool resulstFromUpdate = myDM->addOrUpdateNodes(forMe.
getLogger(), hostname);
78 if (resulstFromUpdate)
85 return make_pair(wasError, errMsg);
89 GetListOfNodes_TYPEID,
97 unordered_map<string, long> myList = myDM->getUpNodesOfCluster();
105 if (hostNames ==
nullptr) {
107 "DistributionManagerServer::registerHandlers - "
108 "CouldNotMakeObjectHostNames");
109 errMsg +=
"CouldNotMakeObjectHostNames";
110 return make_pair(
false, errMsg);
113 for (
auto& ent1 : myList) {
115 string tmpHostName = ent1.first;
116 hostNames->push_back(tmpHostName);
123 if (response ==
nullptr) {
126 "DistributionManagerServer::registerHandlers - "
127 "CouldNotMakeObjectListOfNodes");
128 errMsg +=
"CouldNotMakeObjectListOfNodes";
129 return make_pair(
false, errMsg);
132 response->setHostNames(hostNames);
134 res = sendUsingMe->sendObject(response, errMsg);
139 errMsg +=
"NotEnoughSpace";
141 "DistributionManagerServer::registerHandlers - NotEnoughSpace to make objects");
142 return make_pair(
false, errMsg);
145 return make_pair(res, errMsg);
PDBDistributionManagerPtr getDistributionManager()
~DistributionManagerServer()
PDBDistributionManagerPtr distributionManager
DistributionManagerServer(PDBDistributionManagerPtr distributionManagerIn)
void registerHandlers(PDBServer &forMe) override
std::shared_ptr< PDBCommunicator > PDBCommunicatorPtr
void registerHandler(int16_t typeID, PDBCommWorkPtr handledBy)
std::shared_ptr< PDBLogger > PDBLoggerPtr
void setDistributionManager(PDBDistributionManagerPtr distributionManagerIn)
void makeObjectAllocatorBlock(size_t numBytesIn, bool throwExceptionOnFail)
shared_ptr< PDBDistributionManager > PDBDistributionManagerPtr