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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/startree/v2/builder/MultipleTreesBuilder.java:
##########
@@ -115,13 +126,38 @@ public MultipleTreesBuilder(@Nullable 
List<StarTreeIndexConfig> indexConfigs, bo
     }
   }
 
+  private StarTreeIndexSeparator getSeparator()
+      throws Exception {
+    if (!_metadataProperties.containsKey(MetadataKey.STAR_TREE_COUNT)) {
+      return null;
+    }
+    try {
+      _separatorTempDir = new File(_segmentDirectory, 
StarTreeV2Constants.EXISTING_STAR_TREE_TEMP_DIR);
+      FileUtils.forceMkdir(_separatorTempDir);
+      FileUtils.copyFileToDirectory(
+          new File(_segmentDirectory, StarTreeV2Constants.INDEX_FILE_NAME), 
_separatorTempDir, false);
+      FileUtils.copyFileToDirectory(
+          new File(_segmentDirectory, 
StarTreeV2Constants.INDEX_MAP_FILE_NAME), _separatorTempDir, false);

Review Comment:
   Moving file is much faster than copying file in most FS. Let's use move and 
directly clean up the fields in `_metadataProperties` by doing 
`_metadataProperties.subset(StarTreeV2Constants.MetadataKey.STAR_TREE_SUBSET).clear();`.
 This way we can also avoid reloading the `_metadataProperties`
   



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to