#include "GetNodesWork.h" #include void GetNodesWork::process(char* bufIn, unsigned bufInLen, char* bufOut, unsigned bufOutLen) { std::vector> nodesList; std::list addedNodes; std::list removedNodes; if (NodesTk::downloadNodes(*mgmtdNode, nodeType, nodesList, false)) { // sync the downloaded list with the node store nodes->syncNodes(nodesList, &addedNodes, &removedNodes, localNode.get()); if (!addedNodes.empty()) LOG(GENERAL, WARNING, "Nodes added.", ("addedNodes", addedNodes.size()), nodeType); if (!removedNodes.empty()) LOG(GENERAL, WARNING, "Nodes removed.", ("removedNodes", removedNodes.size()), nodeType); } else { LOG(GENERAL, ERR, "Couldn't download server list from management daemon.", nodeType); } std::list buddyGroupIDList; std::list primaryTargetIDList; std::list secondaryTargetIDList; // update the storage buddy groups if (NodesTk::downloadMirrorBuddyGroups(*mgmtdNode, nodeType, &buddyGroupIDList, &primaryTargetIDList, &secondaryTargetIDList, false) ) { buddyGroupMapper->syncGroupsFromLists(buddyGroupIDList, primaryTargetIDList, secondaryTargetIDList, NumNodeID()); } }