[
https://issues.apache.org/jira/browse/HIVE-24259?focusedWorklogId=554847&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-554847
]
ASF GitHub Bot logged work on HIVE-24259:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Feb/21 17:49
Start Date: 19/Feb/21 17:49
Worklog Time Spent: 10m
Work Description: 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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 554847)
Time Spent: 5h 10m (was: 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 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
> 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)