remove unused worker methods (#4017)

pull/4018/head^2
SaitTalhaNisanci 2020-07-10 13:45:55 +03:00 committed by GitHub
parent 3f50165365
commit 15290bc43b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 71 deletions

View File

@ -43,8 +43,6 @@ static void SendCommandToWorkersParamsInternal(TargetWorkerSet targetWorkerSet,
const Oid *parameterTypes, const Oid *parameterTypes,
const char *const *parameterValues); const char *const *parameterValues);
static void ErrorIfAnyMetadataNodeOutOfSync(List *metadataNodeList); static void ErrorIfAnyMetadataNodeOutOfSync(List *metadataNodeList);
static void SendCommandListToAllWorkersInternal(List *commandList, bool failOnError,
const char *superuser);
static List * OpenConnectionsToWorkersInParallel(TargetWorkerSet targetWorkerSet, static List * OpenConnectionsToWorkersInParallel(TargetWorkerSet targetWorkerSet,
const char *user); const char *user);
static void GetConnectionsResults(List *connectionList, bool failOnError); static void GetConnectionsResults(List *connectionList, bool failOnError);
@ -125,72 +123,6 @@ SendCommandToWorkersWithMetadata(const char *command)
} }
/*
* SendCommandToAllWorkers sends the given command to
* all workers as a superuser.
*/
void
SendCommandToAllWorkers(const char *command, const char *superuser)
{
SendCommandListToAllWorkers(list_make1((char *) command), superuser);
}
/*
* SendCommandListToAllWorkers sends the given command to all workers in
* a single transaction.
*/
void
SendCommandListToAllWorkers(List *commandList, const char *superuser)
{
SendCommandListToAllWorkersInternal(commandList, true, superuser);
}
/*
* SendCommandListToAllWorkersInternal sends the given command to all workers in a single
* transaction as a superuser. If failOnError is false, then it continues sending the commandList to other
* workers even if it fails in one of them.
*/
static void
SendCommandListToAllWorkersInternal(List *commandList, bool failOnError, const
char *superuser)
{
List *workerNodeList = ActivePrimaryNonCoordinatorNodeList(NoLock);
WorkerNode *workerNode = NULL;
foreach_ptr(workerNode, workerNodeList)
{
if (failOnError)
{
SendCommandListToWorkerInSingleTransaction(workerNode->workerName,
workerNode->workerPort,
superuser,
commandList);
}
else
{
SendOptionalCommandListToWorkerInTransaction(workerNode->workerName,
workerNode->workerPort,
superuser,
commandList);
}
}
}
/*
* SendOptionalCommandListToAllWorkers sends the given command to all works in
* a single transaction as a superuser. If there is an error during the command, it is ignored
* so this method doesnt return any error.
*/
void
SendOptionalCommandListToAllWorkers(List *commandList, const char *superuser)
{
SendCommandListToAllWorkersInternal(commandList, false, superuser);
}
/* /*
* TargetWorkerSetNodeList returns a list of WorkerNode's that satisfies the * TargetWorkerSetNodeList returns a list of WorkerNode's that satisfies the
* TargetWorkerSet. * TargetWorkerSet.

View File

@ -42,9 +42,6 @@ extern void SendBareCommandListToMetadataWorkers(List *commandList);
extern int SendBareOptionalCommandListToAllWorkersAsUser(List *commandList, extern int SendBareOptionalCommandListToAllWorkersAsUser(List *commandList,
const char *user); const char *user);
extern void EnsureNoModificationsHaveBeenDone(void); extern void EnsureNoModificationsHaveBeenDone(void);
extern void SendCommandListToAllWorkers(List *commandList, const char *superuser);
extern void SendOptionalCommandListToAllWorkers(List *commandList, const char *superuser);
extern void SendCommandToAllWorkers(const char *command, const char *superuser);
extern void SendCommandListToWorkerInSingleTransaction(const char *nodeName, extern void SendCommandListToWorkerInSingleTransaction(const char *nodeName,
int32 nodePort, int32 nodePort,
const char *nodeUser, const char *nodeUser,