Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/538#discussion_r28644583
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java ---
    @@ -1300,6 +1301,52 @@ protected void stopFinalization() {
         stopShuffleReceiver.set(true);
       }
     
    +  private void finalizeShuffleReport(StageShuffleReportEvent event, 
ShuffleType type) {
    +    if(!checkIfNeedFinalizing(type)) return;
    +
    +    TajoWorkerProtocol.ExecutionBlockReport report = event.getReport();
    +
    +    if (!report.getReportSuccess()) {
    +      stopFinalization();
    +      LOG.error(getId() + ", " + type + " report are failed. Caused by:" + 
report.getReportErrorMessage());
    +      eventHandler.handle(new StageEvent(getId(), 
StageEventType.SQ_FAILED));
    +    }
    +
    +    completedShuffleTasks.addAndGet(report.getSucceededTasks());
    +    if (report.getIntermediateEntriesCount() > 0) {
    +      for (IntermediateEntryProto eachInterm : 
report.getIntermediateEntriesList()) {
    +        hashShuffleIntermediateEntries.add(new 
IntermediateEntry(eachInterm));
    +      }
    +    }
    +
    +    if (completedShuffleTasks.get() >= succeededObjectCount) {
    +      LOG.info(getId() + ", Finalized " + type + " reports: " + 
completedShuffleTasks.get());
    +      eventHandler.handle(new StageEvent(getId(), 
StageEventType.SQ_STAGE_COMPLETED));
    +      if (timeoutChecker != null) {
    +        stopFinalization();
    +        synchronized (timeoutChecker){
    +          timeoutChecker.notifyAll();
    +        }
    +      }
    +    } else {
    +      LOG.info(getId() + ", Received " + type + " reports " +
    +          completedShuffleTasks.get() + "/" + succeededObjectCount);
    +    }
    +  }
    +
    +  /**
    +   * HASH_SHUFFLE, SCATTERED_HASH_SHUFFLE should get report from worker 
nodes when ExecutionBlock is stopping.
    --- End diff --
    
    It would be great if you add a comment that describes why we don't need to 
collect reports when the shuffle type is RANGE_SHUFFLE.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to