hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Himanshu Vashishtha (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HBASE-8476) locateRegionInMeta should check the cache before doing the prefetch
Date Fri, 03 May 2013 23:30:16 GMT

     [ https://issues.apache.org/jira/browse/HBASE-8476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Himanshu Vashishtha resolved HBASE-8476.
----------------------------------------

    Resolution: Fixed
      Assignee: Himanshu Vashishtha  (was: Amitanand Aiyer)

Folded it in HBASE-8346
                
> locateRegionInMeta should check the cache before doing the prefetch
> -------------------------------------------------------------------
>
>                 Key: HBASE-8476
>                 URL: https://issues.apache.org/jira/browse/HBASE-8476
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Amitanand Aiyer
>            Assignee: Himanshu Vashishtha
>            Priority: Minor
>             Fix For: 0.89-fb, 0.95.2
>
>
> 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)) )  {
>               prefetchRegionCache(tableName, row);
>             }
>             // 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) {
>                 return location;
>               }
>             } 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message