You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/06/01 21:13:31 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8812: Fix segment generation error handling

Jackie-Jiang commented on code in PR #8812:
URL: https://github.com/apache/pinot/pull/8812#discussion_r887304419


##########
pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-standalone/src/main/java/org/apache/pinot/plugin/ingestion/batch/standalone/SegmentGenerationJobRunner.java:
##########
@@ -222,6 +229,15 @@ public void run()
         }
       }
       _segmentCreationTaskCountDownLatch.await();
+
+      if (!_failures.isEmpty()) {
+        StringBuilder msg = new StringBuilder("Failed to generate Pinot segment for file(s) - ");
+        _failures.forEach(p -> {
+          msg.append(msg.length() > 0 ? ", " : "");

Review Comment:
   This will always append `", "` because `msg.length()` will never be 0. If we change `_failures` to `Queue<String>`, we can use `StringUtils.join(_failures, ", ")`



##########
pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-standalone/src/main/java/org/apache/pinot/plugin/ingestion/batch/standalone/SegmentGenerationJobRunner.java:
##########
@@ -70,6 +73,7 @@ public class SegmentGenerationJobRunner implements IngestionJobRunner {
   private CountDownLatch _segmentCreationTaskCountDownLatch;
   private Schema _schema;
   private TableConfig _tableConfig;
+  private Queue<Pair<Exception, String>> _failures;

Review Comment:
   The `Exception` is not used. Consider changing it to
   ```suggestion
     private Queue<String> _failureFilePaths;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org