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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to