Skip to content

Commit

Permalink
Naming cleanup in SqlQueryScheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
rschlussel committed Feb 7, 2020
1 parent 615feb5 commit 6525ea9
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ else if (!result.getBlocked().isDone()) {

// make sure to update stage linkage at least once per loop to catch async state changes (e.g., partial cancel)
boolean stageFinishedExecution = false;
for (StageExecutionAndScheduler stageExecutionInfo : scheduledStageExecutions) {
SqlStageExecution stageExecution = stageExecutionInfo.getStageExecution();
for (StageExecutionAndScheduler stageExecutionAndScheduler : scheduledStageExecutions) {
SqlStageExecution stageExecution = stageExecutionAndScheduler.getStageExecution();
StageId stageId = stageExecution.getStageExecutionId().getStageId();
if (!completedStages.contains(stageId) && stageExecution.getState().isDone()) {
stageExecutionInfo.getStageLinkage()
stageExecutionAndScheduler.getStageLinkage()
.processScheduleResults(stageExecution.getState(), ImmutableSet.of());
completedStages.add(stageId);
stageFinishedExecution = true;
Expand All @@ -323,10 +323,10 @@ else if (!result.getBlocked().isDone()) {
}
}

for (StageExecutionAndScheduler stageExecutionInfo : scheduledStageExecutions) {
StageExecutionState state = stageExecutionInfo.getStageExecution().getState();
for (StageExecutionAndScheduler stageExecutionAndScheduler : scheduledStageExecutions) {
StageExecutionState state = stageExecutionAndScheduler.getStageExecution().getState();
if (state != SCHEDULED && state != RUNNING && !state.isDone()) {
throw new PrestoException(GENERIC_INTERNAL_ERROR, format("Scheduling is complete, but stage execution %s is in state %s", stageExecutionInfo.getStageExecution().getStageExecutionId(), state));
throw new PrestoException(GENERIC_INTERNAL_ERROR, format("Scheduling is complete, but stage execution %s is in state %s", stageExecutionAndScheduler.getStageExecution().getStageExecutionId(), state));
}
}

Expand All @@ -343,9 +343,9 @@ else if (!result.getBlocked().isDone()) {
}
finally {
RuntimeException closeError = new RuntimeException();
for (StageExecutionAndScheduler stageExecutionInfo : scheduledStageExecutions) {
for (StageExecutionAndScheduler stageExecutionAndScheduler : scheduledStageExecutions) {
try {
stageExecutionInfo.getStageScheduler().close();
stageExecutionAndScheduler.getStageScheduler().close();
}
catch (Throwable t) {
queryStateMachine.transitionToFailed(t);
Expand Down

0 comments on commit 6525ea9

Please sign in to comment.