daijyc commented on a change in pull request #662: Hive-21787: Metastore table
cache enhancement
URL: https://github.com/apache/hive/pull/662#discussion_r291039847
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
##########
@@ -198,38 +200,40 @@ private void setConfInternal(Configuration conf) {
}
private void initSharedCache(Configuration conf) {
- long maxSharedCacheSizeInBytes =
- MetastoreConf.getSizeVar(conf,
ConfVars.CACHED_RAW_STORE_MAX_CACHE_MEMORY);
- sharedCache.initialize(maxSharedCacheSizeInBytes);
- if (maxSharedCacheSizeInBytes > 0) {
- LOG.info("Maximum memory that the cache will use: {} KB",
- maxSharedCacheSizeInBytes / (1024));
+ synchronized (lock) {
+ if (!sharedCacheInited) {
+ sharedCacheInited = true;
+ } else {
+ return;
+ }
}
+ SharedCache.Builder builder = new SharedCache.Builder();
Review comment:
Should this be in !sharedCacheInited block? Is it normal to use builder
pattern for a singleton? Seems it only need to do some initialization for the
first time? Or do we need to update conf for every CachedStore instantiation?
----------------------------------------------------------------
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]