You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/19 17:49:46 UTC

[GitHub] [hive] sankarh commented on a change in pull request #1610: HIVE-24259: [CachedStore] Optimise get all constraint api

sankarh commented on a change in pull request #1610:
URL: https://github.com/apache/hive/pull/1610#discussion_r579358426



##########
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,

Review comment:
       It is not used anywhere other than below method. We can remove it and move these validations there.

##########
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:
       The method name is too long and not readable. Shall make it shouldGetConstraintFromRawStore().
   

##########
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:
       nit: Add space after each parameter.

##########
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:
       Shall move this method as private method inside CachedStore to avoid passing too many arguments.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org