abhishekagarwal87 commented on code in PR #14984:
URL: https://github.com/apache/druid/pull/14984#discussion_r1337040163


##########
extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentPusher.java:
##########
@@ -124,8 +124,18 @@ public DataSegment pushToPath(File inDir, DataSegment 
segment, String storageDir
         fullyQualifiedStorageDirectory.get(),
         storageDirSuffix
     );
-
-    final String storageDir = StringUtils.format("%s/%s", 
fullyQualifiedStorageDirectory.get(), storageDirSuffix);
+    
+    final String outIndexFilePath;
+    if (storageDirSuffix.endsWith("index.zip")) {

Review Comment:
   The function name is a bit confusing since storageDirSuffix is really a 
suffix to the filename. I looked at various implementations and this is what 
you can do to simplify the logic. Rather than `push` call `pushToPath` 
directly, both of these functions can call a separate third private function. 
`push` will create the right suffix by adding index.zip and so would 
`pushToPath`. `pushToPath` will add the suffix in the same way as 
org.apache.druid.storage.s3.S3Utils#constructSegmentPath
   
   How does that sound? 



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

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