You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by da...@apache.org on 2021/09/04 07:54:10 UTC

[hudi] branch master updated: [HUDI-2380] The default archive folder should be 'archived' (#3568)

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

danny0405 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 e9bf1c1  [HUDI-2380] The default archive folder should be 'archived' (#3568)
e9bf1c1 is described below

commit e9bf1c1186532e6958d5671fd6244958cba16dbe
Author: Danny Chan <yu...@gmail.com>
AuthorDate: Sat Sep 4 15:53:55 2021 +0800

    [HUDI-2380] The default archive folder should be 'archived' (#3568)
---
 .../test/java/org/apache/hudi/cli/commands/TestTableCommand.java    | 5 ++++-
 .../java/org/apache/hudi/common/table/HoodieTableMetaClient.java    | 6 +-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestTableCommand.java b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestTableCommand.java
index fe3407f..79c40cb 100644
--- a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestTableCommand.java
+++ b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestTableCommand.java
@@ -25,6 +25,7 @@ import org.apache.hudi.cli.testutils.HoodieTestCommitMetadataGenerator;
 import org.apache.hudi.common.fs.ConsistencyGuardConfig;
 import org.apache.hudi.common.model.HoodieCommitMetadata;
 import org.apache.hudi.common.model.HoodieTableType;
+import org.apache.hudi.common.table.HoodieTableConfig;
 import org.apache.hudi.common.table.HoodieTableMetaClient;
 import org.apache.hudi.common.table.timeline.HoodieTimeline;
 import org.apache.hudi.common.table.timeline.versioning.TimelineLayoutVersion;
@@ -60,6 +61,7 @@ public class TestTableCommand extends AbstractShellIntegrationTest {
   private final String tableName = "test_table";
   private String tablePath;
   private String metaPath;
+  private String archivePath;
 
   /**
    * Init path after Mini hdfs init.
@@ -69,6 +71,7 @@ public class TestTableCommand extends AbstractShellIntegrationTest {
     HoodieCLI.conf = jsc.hadoopConfiguration();
     tablePath = basePath + File.separator + tableName;
     metaPath = tablePath + File.separator + METAFOLDER_NAME;
+    archivePath = metaPath + File.separator + HoodieTableConfig.ARCHIVELOG_FOLDER.defaultValue();
   }
 
   /**
@@ -115,7 +118,7 @@ public class TestTableCommand extends AbstractShellIntegrationTest {
 
     // Test meta
     HoodieTableMetaClient client = HoodieCLI.getTableMetaClient();
-    assertEquals(metaPath, client.getArchivePath());
+    assertEquals(archivePath, client.getArchivePath());
     assertEquals(tablePath, client.getBasePath());
     assertEquals(metaPath, client.getMetaPath());
     assertEquals(HoodieTableType.COPY_ON_WRITE, client.getTableType());
diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java b/hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java
index e4494bd..97464b1 100644
--- a/hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java
+++ b/hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java
@@ -227,11 +227,7 @@ public class HoodieTableMetaClient implements Serializable {
    */
   public String getArchivePath() {
     String archiveFolder = tableConfig.getArchivelogFolder();
-    if (archiveFolder.equals(HoodieTableConfig.ARCHIVELOG_FOLDER.defaultValue())) {
-      return getMetaPath();
-    } else {
-      return getMetaPath() + "/" + archiveFolder;
-    }
+    return getMetaPath() + "/" + archiveFolder;
   }
 
   /**