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 2019/10/14 18:49:14 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4706: Adding option to load a Pinot segment as post creation verification

Jackie-Jiang commented on a change in pull request #4706: Adding option to load a Pinot segment as post creation verification
URL: https://github.com/apache/incubator-pinot/pull/4706#discussion_r334616247
 
 

 ##########
 File path: pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/CreateSegmentCommand.java
 ##########
 @@ -413,6 +445,32 @@ public void run() {
     return executor.awaitTermination(1, TimeUnit.HOURS);
   }
 
+  private boolean verifySegment(String indexDirStr) {
+    SegmentMetadataImpl segmentMetadata;
+    File localTempDir;
+    try {
+      localTempDir = new File("segmentVerification", org.apache.pinot.common.utils.FileUtils.getRandomFileName());
+      FileSystem.get(URI.create(indexDirStr), new Configuration())
+          .copyToLocalFile(new Path(indexDirStr), new Path(localTempDir.toString()));
+    } catch (IOException e) {
+      LOGGER.error("Failed to copy segment {} to local directory for verification.", indexDirStr, e);
+      return false;
+    }
+    try {
 
 Review comment:
   I don't think this will work. You need to untar the segment first.
   I would recommend untar the segment, then use `ImmutableSegmentLoader.load()` to verify if you can load the segment.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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