daijyc commented on a change in pull request #662: Hive-21787: Metastore table
cache enhancement
URL: https://github.com/apache/hive/pull/662#discussion_r291863520
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java
##########
@@ -1480,47 +1688,52 @@ public boolean refreshTablesInCache(String catName,
String dbName, List<Table> t
}
}
- public ColumnStatistics getTableColStatsFromCache(String catName, String
dbName,
- String tblName, List<String> colNames, String validWriteIds, boolean
areTxnStatsSupported) throws MetaException {
+ public ColumnStatistics getTableColStatsFromCache(String catName, String
dbName, String tblName,
+ List<String> colNames, String validWriteIds, boolean
areTxnStatsSupported) throws MetaException {
try {
cacheLock.readLock().lock();
- TableWrapper tblWrapper =
tableCache.get(CacheUtils.buildTableKey(catName, dbName, tblName));
+ tableCacheRWLock.readLock().lock();
Review comment:
For operation involving only one table (not involving multiple tables), we
don´t need to put a global lock. There are several more places, don´t further
comment.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]