ndimiduk commented on pull request #4014:
URL: https://github.com/apache/hbase/pull/4014#issuecomment-1006902804


   reviewers: please notice this change to internal behavior of caching region 
locations in `HRegionLocator#listRegionLocations()`. I believe that the 
contents of the cache are identical before and after this change, but how the 
cache is populated is slightly different now.
   
   Previously, this method returned a `List<RegionLocations>`. In that 
implementation, each entry in the list represented a `Result` object processed 
by the `Visitor`. These entries were then presented to the connection for 
caching one-by-one. The logic used to merge old and new cache entries was also 
used to merge all of these new results.
   
   I think the one-to-one mapping is an unnecessary preservation of arbitrary 
physical topology of the scan of the meta region. The change here has 
`listRegionLocations()` perform this consolidation before returning results. 
Performing the `consolidate` action here allows the `HRegionLocator` to behave 
in a manner that is similar to `AsyncRegionLocator` and even reuse some of its 
code.
   
   This new implementation may also make region caching slightly (negligibly) 
faster because the logic for cache entry management is quite complex, while the 
logic for naively combining multiple `RegionLocations` objects into a single 
instance is much simpler.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to