Remove dead code: ResponsiveWorkerNodeList

pull/996/head
Brian Cloutier 2016-11-24 05:32:57 +03:00 committed by Brian Cloutier
parent 0a4889d0af
commit a4096c9f45
2 changed files with 0 additions and 51 deletions

View File

@ -41,7 +41,6 @@ static WorkerNode * FindRandomNodeNotInList(HTAB *WorkerNodesHash,
List *currentNodeList);
static bool OddNumber(uint32 number);
static bool ListMember(List *currentList, WorkerNode *workerNode);
static bool WorkerNodeResponsive(const char *workerName, uint32 workerPort);
/* ------------------------------------------------------------
@ -478,52 +477,3 @@ WorkerNodeCompare(const void *lhsKey, const void *rhsKey, Size keySize)
portCompare = workerLhs->workerPort - workerRhs->workerPort;
return portCompare;
}
/* ResponsiveWorkerNodeList returns a list of all responsive worker nodes */
List *
ResponsiveWorkerNodeList(void)
{
List *responsiveWorkerNodeList = NULL;
ListCell *workerNodeCell = NULL;
List *workerNodeList = WorkerNodeList();
foreach(workerNodeCell, workerNodeList)
{
bool workerNodeResponsive = false;
WorkerNode *workerNode = lfirst(workerNodeCell);
workerNodeResponsive = WorkerNodeResponsive(workerNode->workerName,
workerNode->workerPort);
if (workerNodeResponsive)
{
responsiveWorkerNodeList = lappend(responsiveWorkerNodeList, workerNode);
}
}
return responsiveWorkerNodeList;
}
/*
* WorkerNodeResponsive returns true if the given worker node is reponsive.
* Otherwise, it returns false.
*
* This function is based on worker_node_responsive function present in the
* shard rebalancer.
*/
static bool
WorkerNodeResponsive(const char *workerName, uint32 workerPort)
{
bool workerNodeResponsive = false;
int connectionId = MultiClientConnect(workerName, workerPort, NULL, NULL);
if (connectionId != INVALID_CONNECTION_ID)
{
MultiClientDisconnect(connectionId);
workerNodeResponsive = true;
}
return workerNodeResponsive;
}

View File

@ -60,7 +60,6 @@ extern WorkerNode * WorkerGetLocalFirstCandidateNode(List *currentNodeList);
extern WorkerNode * WorkerGetNodeWithName(const char *hostname);
extern uint32 WorkerGetLiveNodeCount(void);
extern List * WorkerNodeList(void);
extern List * ResponsiveWorkerNodeList(void);
extern WorkerNode * FindWorkerNode(char *nodeName, int32 nodePort);
extern List * ReadWorkerNodes(void);