[ https://issues.apache.org/jira/browse/HIVE-26825?focusedWorklogId=839506&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-839506 ]
ASF GitHub Bot logged work on HIVE-26825: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/Jan/23 05:02 Start Date: 17/Jan/23 05:02 Worklog Time Spent: 10m Work Description: rkirtir commented on code in PR #3864: URL: https://github.com/apache/hive/pull/3864#discussion_r1071738311 ########## ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/MetaStoreCompactorThread.java: ########## @@ -133,4 +141,27 @@ protected static long updateCycleDurationMetric(String metric, long startedAt) { } return 0; } + + <T extends TBase<T,?>> T computeIfAbsent(String key, Callable<T> callable) throws Exception { + if (metaCache.isPresent()) { + try { + return (T) metaCache.get().get(key, callable); + } catch (ExecutionException e) { + throw (Exception) e.getCause(); + } + } + return callable.call(); + } + + Optional<Cache<String, TBase>> initializeCache(boolean tableCacheOn) { + if (tableCacheOn) { + metaCache = Optional.of(CacheBuilder.newBuilder().softValues().build()); + } + return metaCache; + } + + protected void invalidateMetaCache(){ Review Comment: done Issue Time Tracking ------------------- Worklog Id: (was: 839506) Time Spent: 2h 40m (was: 2.5h) > Compactor: Cleaner shouldn't fetch table details again and again for > partitioned tables > --------------------------------------------------------------------------------------- > > Key: HIVE-26825 > URL: https://issues.apache.org/jira/browse/HIVE-26825 > Project: Hive > Issue Type: Improvement > Components: Transactions > Reporter: KIRTI RUGE > Assignee: KIRTI RUGE > Priority: Major > Labels: pull-request-available > Time Spent: 2h 40m > Remaining Estimate: 0h > > Cleaner shouldn't be fetch table/partition details for all its partitions. > When there are large number of databases/tables, it takes lot of time for > Initiator to complete its initial iteration and load on DB also goes higher. -- This message was sent by Atlassian Jira (v8.20.10#820010)