Skip to content

Commit

Permalink
Extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Aug 16, 2024
1 parent a9876b5 commit 59884cc
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,6 @@ private void createStageExecution(
sinkPartitioningScheme.getPartitionCount(),
preserveOrderWithinPartition));

boolean coordinatorStage = stage.getFragment().getPartitioning().equals(COORDINATOR_DISTRIBUTION);

if (eager) {
sourceExchanges.values().forEach(sourceExchange -> sourceExchange.setSourceHandlesDeliveryMode(EAGER));
}
Expand All @@ -1493,7 +1491,7 @@ private void createStageExecution(
memoryEstimatorFactory.createPartitionMemoryEstimator(session, fragment, planFragmentLookup),
outputStatsEstimator,
// do not retry coordinator only tasks
coordinatorStage ? 1 : maxTaskExecutionAttempts,
shouldRetry(stage) ? maxTaskExecutionAttempts : 1,
schedulingPriority,
eager,
speculative,
Expand All @@ -1518,6 +1516,12 @@ private void createStageExecution(
}
}

private static boolean shouldRetry(SqlStage stage)
{
boolean coordinatorStage = stage.getFragment().getPartitioning().equals(COORDINATOR_DISTRIBUTION);
return !coordinatorStage;
}

private StageId getStageId(PlanFragmentId fragmentId)
{
return StageId.create(queryStateMachine.getQueryId(), fragmentId);
Expand Down

0 comments on commit 59884cc

Please sign in to comment.