This is an automated email from the ASF dual-hosted git repository.

codope pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new da9fef6046 [HUDI-5345] Avoid fs.exists calls for metadata table in 
HFileBootstrapIndex (#7404)
da9fef6046 is described below

commit da9fef60463e4aef323e58f3b1c62a8cc3419dce
Author: Y Ethan Guo <[email protected]>
AuthorDate: Thu Dec 8 04:03:42 2022 -0800

    [HUDI-5345] Avoid fs.exists calls for metadata table in HFileBootstrapIndex 
(#7404)
---
 .../org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/hudi-common/src/main/java/org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java
 
b/hudi-common/src/main/java/org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java
index b8a2c202cb..718fff3cf3 100644
--- 
a/hudi-common/src/main/java/org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java
+++ 
b/hudi-common/src/main/java/org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java
@@ -34,6 +34,7 @@ import org.apache.hudi.common.util.collection.Pair;
 import org.apache.hudi.exception.HoodieException;
 import org.apache.hudi.exception.HoodieIOException;
 import org.apache.hudi.io.storage.HoodieHFileUtils;
+import org.apache.hudi.metadata.HoodieTableMetadata;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -101,7 +102,10 @@ public class HFileBootstrapIndex extends BootstrapIndex {
     Path indexByFilePath = fileIdIndexPath(metaClient);
     try {
       FileSystem fs = metaClient.getFs();
-      isPresent = fs.exists(indexByPartitionPath) && 
fs.exists(indexByFilePath);
+      // The metadata table is never bootstrapped, so the bootstrap index is 
always absent
+      // for the metadata table.  The fs.exists calls are avoided for metadata 
table.
+      isPresent = 
!HoodieTableMetadata.isMetadataTable(metaClient.getBasePathV2().toString())
+          && fs.exists(indexByPartitionPath) && fs.exists(indexByFilePath);
     } catch (IOException ioe) {
       throw new HoodieIOException(ioe.getMessage(), ioe);
     }

Reply via email to