1
0

[HUDI-2779] Cache BaseDir if HudiTableNotFound Exception thrown (#4014)

This commit is contained in:
RexAn
2021-12-09 18:34:11 +08:00
committed by GitHub
parent 5ac9ce7289
commit f612a20815
2 changed files with 14 additions and 2 deletions

View File

@@ -68,9 +68,11 @@ public class TestHoodieROTablePathFilter extends HoodieCommonTestHarness {
assertFalse(pathFilter.accept(testTable.getInflightCommitFilePath("003")));
assertFalse(pathFilter.accept(testTable.getRequestedCompactionFilePath("004")));
assertFalse(pathFilter.accept(new Path("file:///" + basePath + "/" + HoodieTableMetaClient.METAFOLDER_NAME + "/")));
assertFalse(pathFilter.accept(new Path("file:///" + basePath + "/" + HoodieTableMetaClient.METAFOLDER_NAME + "/hoodie.properties")));
assertFalse(pathFilter.accept(new Path("file:///" + basePath + "/" + HoodieTableMetaClient.METAFOLDER_NAME)));
assertEquals(1, pathFilter.metaClientCache.size());
assertEquals(0, pathFilter.nonHoodiePathCache.size(), "NonHoodiePathCache size should be 0");
}
@Test
@@ -82,6 +84,7 @@ public class TestHoodieROTablePathFilter extends HoodieCommonTestHarness {
java.nio.file.Path path2 = Paths.get(basePath, "nonhoodiefolder/somefile");
Files.createFile(path2);
assertTrue(pathFilter.accept(new Path(path2.toUri())));
assertEquals(2, pathFilter.nonHoodiePathCache.size(), "NonHoodiePathCache size should be 2");
}
@Test
@@ -93,5 +96,6 @@ public class TestHoodieROTablePathFilter extends HoodieCommonTestHarness {
Path partitionPath2 = testTable.getPartitionPath(p2).getParent();
assertTrue(pathFilter.accept(partitionPath1), "Directories should be accepted");
assertTrue(pathFilter.accept(partitionPath2), "Directories should be accepted");
assertEquals(2, pathFilter.nonHoodiePathCache.size(), "NonHoodiePathCache size should be 2");
}
}