[ https://issues.apache.org/jira/browse/HIVE-24259?focusedWorklogId=548024&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-548024 ]
ASF GitHub Bot logged work on HIVE-24259: ----------------------------------------- Author: ASF GitHub Bot Created on: 05/Feb/21 03:55 Start Date: 05/Feb/21 03:55 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_r570703754 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java ########## @@ -309,12 +302,19 @@ public int getObjectSize(Class<?> clazz, Object obj) { private Map<String, SQLDefaultConstraint> defaultConstraintCache = new ConcurrentHashMap<>(); private Map<String, SQLCheckConstraint> checkConstraintCache = new ConcurrentHashMap<>(); + private boolean pk = false; Review comment: Changes are as follows 1. Replace 6 flag with 1 flag 2. In cache refresh/update flow removed 6 call to raw metastore with getAllTableConstraints() 3. While adding table to cache via createTable and createTableWithConstraint isConstraintValid flag is set as true. 4. If isConstraintValid flag is true then return data from cache else redirect to raw metastore. 5. While adding individual constraint to metastore if isConstraintValid is true that means constraints snapshot is valid and new constraint can be updated in cachestore else skip update. 6. isConstraintValid will only be true if all the constraint value are valid in the metastore else redirect to raw metastore (For the case of partial constraint storage due to memory shortage) ---------------------------------------------------------------- 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: 548024) Time Spent: 2h 10m (was: 2h) > [CachedStore] Optimise get constraints call by removing redundant table check > ------------------------------------------------------------------------------ > > 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: 2h 10m > 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 > > DOD > 1. Check only once if table exit in cached store. > 2. Instead of calling individual constraint in cached store. Add a method > which return all constraint at once and if data is not consistent then fall > back to rawstore. -- This message was sent by Atlassian Jira (v8.3.4#803005)