Description
locateRegionInMeta uses a regionLockObject to synchronize all accesses to prefetch the RegionCache.
synchronized (regionLockObject) {
// If the parent table is META, we may want to pre-fetch some
// region info into the global region cache for this table.
if (Bytes.equals(parentTable, HConstants.META_TABLE_NAME) &&
(getRegionCachePrefetch(tableName)) )
// Check the cache again for a hit in case some other thread made the
// same query while we were waiting on the lock. If not supposed to
// be using the cache, delete any existing cached location so it won't
// interfere.
if (useCache) {
location = getCachedLocation(tableName, row);
if (location != null)
} else
{ deleteCachedLocation(tableName, row); }However, for this to be effective, we need to check the cache as soon as we grab the lock; before doing the prefetch. Checking the cache after doing the prefetch does not help the current thread, in case another thread has done the prefetch.
Attachments
Issue Links
- is related to
-
HBASE-8346 Prefetching .META. rows in case only when useCache is set to true
- Closed
- relates to
-
HBASE-8655 Backport to 94 - HBASE-8346(Prefetching .META. rows in case only when useCache is set to true)
- Closed