mirror of https://github.com/citusdata/citus.git
Refactors ExtendedTaskList methods (#7372)
ExecuteTaskListIntoTupleDestWithParam and ExecuteTaskListIntoTupleDest are nearly the same. I parameterized and a made a reusable structure here --------- Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>pull/7447/head
parent
11d7c27352
commit
863713e9b7
|
@ -727,6 +727,11 @@ static uint64 MicrosecondsBetweenTimestamps(instr_time startTime, instr_time end
|
|||
static int WorkerPoolCompare(const void *lhsKey, const void *rhsKey);
|
||||
static void SetAttributeInputMetadata(DistributedExecution *execution,
|
||||
ShardCommandExecution *shardCommandExecution);
|
||||
static ExecutionParams * CreateDefaultExecutionParams(RowModifyLevel modLevel,
|
||||
List *taskList,
|
||||
TupleDestination *tupleDest,
|
||||
bool expectResults,
|
||||
ParamListInfo paramListInfo);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1013,11 +1018,11 @@ ExecuteTaskListOutsideTransaction(RowModifyLevel modLevel, List *taskList,
|
|||
|
||||
|
||||
/*
|
||||
* ExecuteTaskListIntoTupleDestWithParam is a proxy to ExecuteTaskListExtended() which uses
|
||||
* bind params from executor state, and with defaults for some of the arguments.
|
||||
* CreateDefaultExecutionParams returns execution params based on given (possibly null)
|
||||
* bind params (presumably from executor state) with defaults for some of the arguments.
|
||||
*/
|
||||
uint64
|
||||
ExecuteTaskListIntoTupleDestWithParam(RowModifyLevel modLevel, List *taskList,
|
||||
static ExecutionParams *
|
||||
CreateDefaultExecutionParams(RowModifyLevel modLevel, List *taskList,
|
||||
TupleDestination *tupleDest,
|
||||
bool expectResults,
|
||||
ParamListInfo paramListInfo)
|
||||
|
@ -1034,6 +1039,24 @@ ExecuteTaskListIntoTupleDestWithParam(RowModifyLevel modLevel, List *taskList,
|
|||
executionParams->tupleDestination = tupleDest;
|
||||
executionParams->paramListInfo = paramListInfo;
|
||||
|
||||
return executionParams;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ExecuteTaskListIntoTupleDestWithParam is a proxy to ExecuteTaskListExtended() which uses
|
||||
* bind params from executor state, and with defaults for some of the arguments.
|
||||
*/
|
||||
uint64
|
||||
ExecuteTaskListIntoTupleDestWithParam(RowModifyLevel modLevel, List *taskList,
|
||||
TupleDestination *tupleDest,
|
||||
bool expectResults,
|
||||
ParamListInfo paramListInfo)
|
||||
{
|
||||
ExecutionParams *executionParams = CreateDefaultExecutionParams(modLevel, taskList,
|
||||
tupleDest,
|
||||
expectResults,
|
||||
paramListInfo);
|
||||
return ExecuteTaskListExtended(executionParams);
|
||||
}
|
||||
|
||||
|
@ -1047,17 +1070,11 @@ ExecuteTaskListIntoTupleDest(RowModifyLevel modLevel, List *taskList,
|
|||
TupleDestination *tupleDest,
|
||||
bool expectResults)
|
||||
{
|
||||
int targetPoolSize = MaxAdaptiveExecutorPoolSize;
|
||||
bool localExecutionSupported = true;
|
||||
ExecutionParams *executionParams = CreateBasicExecutionParams(
|
||||
modLevel, taskList, targetPoolSize, localExecutionSupported
|
||||
);
|
||||
|
||||
executionParams->xactProperties = DecideTransactionPropertiesForTaskList(
|
||||
modLevel, taskList, false);
|
||||
executionParams->expectResults = expectResults;
|
||||
executionParams->tupleDestination = tupleDest;
|
||||
|
||||
ParamListInfo paramListInfo = NULL;
|
||||
ExecutionParams *executionParams = CreateDefaultExecutionParams(modLevel, taskList,
|
||||
tupleDest,
|
||||
expectResults,
|
||||
paramListInfo);
|
||||
return ExecuteTaskListExtended(executionParams);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue