jon-wei commented on a change in pull request #11075:
URL: https://github.com/apache/druid/pull/11075#discussion_r612124990



##########
File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/JobHelper.java
##########
@@ -482,20 +475,16 @@ public long push() throws IOException
         .withSize(size.get())
         .withBinaryVersion(SegmentUtils.getVersionFromDir(mergedBase));
 
-    if (!renameIndexFiles(outputFS, tmpPath, finalIndexZipFilePath)) {
-      throw new IOE(
-          "Unable to rename [%s] to [%s]",
-          tmpPath.toUri().toString(),
-          finalIndexZipFilePath.toUri().toString()
-      );
-    }
-
-    return finalSegment;
+    return new DataSegmentAndIndexZipFilePath(
+        finalSegment,
+        tmpPath.toUri().getPath(),
+        finalIndexZipFilePath.toUri().getPath()
+    );
   }
 
   public static void writeSegmentDescriptor(

Review comment:
       this method also deletes and creates a file, I think the descriptor 
creation should also be moved into the main task (it could be handled in 
`renameIndexFile` where you have access to a FileSystem). The mappers/reducers 
would produce a segment file at a temp location and the main task would handle 
the rename->create descriptor->publish flow




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to