1
0

[HUDI-2380] The default archive folder should be 'archived' (#3568)

This commit is contained in:
Danny Chan
2021-09-04 15:53:55 +08:00
committed by GitHub
parent 073c318d9f
commit e9bf1c1186
2 changed files with 5 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ import org.apache.hudi.cli.testutils.HoodieTestCommitMetadataGenerator;
import org.apache.hudi.common.fs.ConsistencyGuardConfig; import org.apache.hudi.common.fs.ConsistencyGuardConfig;
import org.apache.hudi.common.model.HoodieCommitMetadata; import org.apache.hudi.common.model.HoodieCommitMetadata;
import org.apache.hudi.common.model.HoodieTableType; 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.HoodieTableMetaClient;
import org.apache.hudi.common.table.timeline.HoodieTimeline; import org.apache.hudi.common.table.timeline.HoodieTimeline;
import org.apache.hudi.common.table.timeline.versioning.TimelineLayoutVersion; 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 final String tableName = "test_table";
private String tablePath; private String tablePath;
private String metaPath; private String metaPath;
private String archivePath;
/** /**
* Init path after Mini hdfs init. * Init path after Mini hdfs init.
@@ -69,6 +71,7 @@ public class TestTableCommand extends AbstractShellIntegrationTest {
HoodieCLI.conf = jsc.hadoopConfiguration(); HoodieCLI.conf = jsc.hadoopConfiguration();
tablePath = basePath + File.separator + tableName; tablePath = basePath + File.separator + tableName;
metaPath = tablePath + File.separator + METAFOLDER_NAME; 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 // Test meta
HoodieTableMetaClient client = HoodieCLI.getTableMetaClient(); HoodieTableMetaClient client = HoodieCLI.getTableMetaClient();
assertEquals(metaPath, client.getArchivePath()); assertEquals(archivePath, client.getArchivePath());
assertEquals(tablePath, client.getBasePath()); assertEquals(tablePath, client.getBasePath());
assertEquals(metaPath, client.getMetaPath()); assertEquals(metaPath, client.getMetaPath());
assertEquals(HoodieTableType.COPY_ON_WRITE, client.getTableType()); assertEquals(HoodieTableType.COPY_ON_WRITE, client.getTableType());

View File

@@ -227,12 +227,8 @@ public class HoodieTableMetaClient implements Serializable {
*/ */
public String getArchivePath() { public String getArchivePath() {
String archiveFolder = tableConfig.getArchivelogFolder(); String archiveFolder = tableConfig.getArchivelogFolder();
if (archiveFolder.equals(HoodieTableConfig.ARCHIVELOG_FOLDER.defaultValue())) {
return getMetaPath();
} else {
return getMetaPath() + "/" + archiveFolder; return getMetaPath() + "/" + archiveFolder;
} }
}
/** /**
* @return Table Config * @return Table Config