Skip to content

Commit

Permalink
HIVE-26825 : Compactor: Cleaner shouldn't fetch table details again a…
Browse files Browse the repository at this point in the history
…nd again for partitioned tables
  • Loading branch information
Kirti Ruge committed Jan 9, 2023
1 parent cfe50b0 commit 053e65d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -138,6 +138,7 @@ protected static long updateCycleDurationMetric(String metric, long startedAt) {
}
return 0;
}

<T extends TBase<T,?>> T computeIfAbsent(Optional<Cache<String, TBase>> metaCache, String key, Callable<T> callable) throws Exception {
if (metaCache.isPresent()) {
try {
Expand Down
Expand Up @@ -1117,10 +1117,12 @@ public void testMetaCache() throws Exception {
cleaner.setConf(conf);
cleaner.init(new AtomicBoolean(true));
cleaner.run();
cleaner.run();

ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
List<ShowCompactResponseElement> compacts = rsp.getCompacts();
Assert.assertEquals(1, compacts.size());
Mockito.verify(cleaner, times(2)).computeIfAbsent(Mockito.any(),Mockito.any(),Mockito.any());
Mockito.verify(cleaner, times(1)).resolveTable(Mockito.any());
}

Expand Down

0 comments on commit 053e65d

Please sign in to comment.