[HUDI-2380] The default archive folder should be 'archived' (#3568)
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
@@ -227,11 +227,7 @@ 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() + "/" + archiveFolder;
|
||||||
return getMetaPath();
|
|
||||||
} else {
|
|
||||||
return getMetaPath() + "/" + archiveFolder;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user