[
https://issues.apache.org/jira/browse/HIVE-26825?focusedWorklogId=838845&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-838845
]
ASF GitHub Bot logged work on HIVE-26825:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Jan/23 12:18
Start Date: 12/Jan/23 12:18
Worklog Time Spent: 10m
Work Description: veghlaci05 commented on code in PR #3864:
URL: https://github.com/apache/hive/pull/3864#discussion_r1068053535
##########
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:
Is there a reason why this method has different access modifier than the
other two? In this case both default and protected works, but I would set the
same for all three.
Issue Time Tracking
-------------------
Worklog Id: (was: 838845)
Time Spent: 2h (was: 1h 50m)
> 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
> 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)