[ https://issues.apache.org/jira/browse/HIVE-24259?focusedWorklogId=555156&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-555156 ]
ASF GitHub Bot logged work on HIVE-24259: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Feb/21 12:07 Start Date: 20/Feb/21 12:07 Worklog Time Spent: 10m Work Description: ashish-kumar-sharma commented on a change in pull request #1610: URL: https://github.com/apache/hive/pull/1610#discussion_r579648239 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java ########## @@ -144,4 +147,15 @@ public static boolean matches(String name, String pattern) { } return false; } + + public static boolean validateShouldCacheTableCanUseEventIsActiveTransaction(String catName, String dbName, + String tblName, boolean canUseEvents, RawStore rawStore) { + return !shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction()); + } + + public static boolean validateShouldCacheTableCanUseEventIsActiveTransactionIsConstraintsValid(String catName, Review comment: done ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java ########## @@ -2554,8 +2554,7 @@ long getPartsFound() { catName = StringUtils.normalizeIdentifier(catName); dbName = StringUtils.normalizeIdentifier(dbName); tblName = StringUtils.normalizeIdentifier(tblName); - if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction()) || !sharedCache - .isTableConstraintValid(catName, dbName, tblName)) { + if (validateShouldCacheTableCanUseEventIsActiveTransactionIsConstraintsValid(catName,dbName,tblName,canUseEvents,rawStore,sharedCache)) { Review comment: done ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 555156) Time Spent: 5h 40m (was: 5.5h) > [CachedStore] Optimise get all constraint api > --------------------------------------------- > > Key: HIVE-24259 > URL: https://issues.apache.org/jira/browse/HIVE-24259 > Project: Hive > Issue Type: Sub-task > Reporter: Ashish Sharma > Assignee: Ashish Sharma > Priority: Minor > Labels: pull-request-available > Time Spent: 5h 40m > Remaining Estimate: 0h > > Description - > Problem - > 1. Redundant check if table is present or not > 2. Currently in order to get all constraint form the cachedstore. 6 different > call is made with in the cached store. Which led to 6 different call to raw > store > 3. If constraints are null and valid then also a redundant call is made to > raw store. > > DOD > 1. Create a flag which tell weather constraint snapshot is valid or not. > 2. if incremental addition happen to any of the constraint mark snapshot as > invalid and let updater thread to update cache with valid snapshot data. > 3. Combine individual constraint call into one call for refresh and creation. > -- This message was sent by Atlassian Jira (v8.3.4#803005)