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 int WorkerPoolCompare(const void *lhsKey, const void *rhsKey);
|
||||||
static void SetAttributeInputMetadata(DistributedExecution *execution,
|
static void SetAttributeInputMetadata(DistributedExecution *execution,
|
||||||
ShardCommandExecution *shardCommandExecution);
|
ShardCommandExecution *shardCommandExecution);
|
||||||
|
static ExecutionParams * CreateDefaultExecutionParams(RowModifyLevel modLevel,
|
||||||
|
List *taskList,
|
||||||
|
TupleDestination *tupleDest,
|
||||||
|
bool expectResults,
|
||||||
|
ParamListInfo paramListInfo);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1013,14 +1018,14 @@ ExecuteTaskListOutsideTransaction(RowModifyLevel modLevel, List *taskList,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ExecuteTaskListIntoTupleDestWithParam is a proxy to ExecuteTaskListExtended() which uses
|
* CreateDefaultExecutionParams returns execution params based on given (possibly null)
|
||||||
* bind params from executor state, and with defaults for some of the arguments.
|
* bind params (presumably from executor state) with defaults for some of the arguments.
|
||||||
*/
|
*/
|
||||||
uint64
|
static ExecutionParams *
|
||||||
ExecuteTaskListIntoTupleDestWithParam(RowModifyLevel modLevel, List *taskList,
|
CreateDefaultExecutionParams(RowModifyLevel modLevel, List *taskList,
|
||||||
TupleDestination *tupleDest,
|
TupleDestination *tupleDest,
|
||||||
bool expectResults,
|
bool expectResults,
|
||||||
ParamListInfo paramListInfo)
|
ParamListInfo paramListInfo)
|
||||||
{
|
{
|
||||||
int targetPoolSize = MaxAdaptiveExecutorPoolSize;
|
int targetPoolSize = MaxAdaptiveExecutorPoolSize;
|
||||||
bool localExecutionSupported = true;
|
bool localExecutionSupported = true;
|
||||||
|
@ -1034,6 +1039,24 @@ ExecuteTaskListIntoTupleDestWithParam(RowModifyLevel modLevel, List *taskList,
|
||||||
executionParams->tupleDestination = tupleDest;
|
executionParams->tupleDestination = tupleDest;
|
||||||
executionParams->paramListInfo = paramListInfo;
|
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);
|
return ExecuteTaskListExtended(executionParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1047,17 +1070,11 @@ ExecuteTaskListIntoTupleDest(RowModifyLevel modLevel, List *taskList,
|
||||||
TupleDestination *tupleDest,
|
TupleDestination *tupleDest,
|
||||||
bool expectResults)
|
bool expectResults)
|
||||||
{
|
{
|
||||||
int targetPoolSize = MaxAdaptiveExecutorPoolSize;
|
ParamListInfo paramListInfo = NULL;
|
||||||
bool localExecutionSupported = true;
|
ExecutionParams *executionParams = CreateDefaultExecutionParams(modLevel, taskList,
|
||||||
ExecutionParams *executionParams = CreateBasicExecutionParams(
|
tupleDest,
|
||||||
modLevel, taskList, targetPoolSize, localExecutionSupported
|
expectResults,
|
||||||
);
|
paramListInfo);
|
||||||
|
|
||||||
executionParams->xactProperties = DecideTransactionPropertiesForTaskList(
|
|
||||||
modLevel, taskList, false);
|
|
||||||
executionParams->expectResults = expectResults;
|
|
||||||
executionParams->tupleDestination = tupleDest;
|
|
||||||
|
|
||||||
return ExecuteTaskListExtended(executionParams);
|
return ExecuteTaskListExtended(executionParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue