Package org.apache.hadoop.hbase.client
Class AsyncRegionLocatorHelper
java.lang.Object
org.apache.hadoop.hbase.client.AsyncRegionLocatorHelper
Helper class for asynchronous region locator.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
canUpdateOnError
(HRegionLocation loc, HRegionLocation oldLoc) (package private) static RegionLocations
(package private) static boolean
isGood
(RegionLocations locs, int replicaId) (package private) static RegionLocations
removeRegionLocation
(RegionLocations oldLocs, int replicaId) Create a newRegionLocations
based on the givenoldLocs
, and remove the location for the givenreplicaId
.(package private) static RegionLocations
replaceRegionLocation
(RegionLocations oldLocs, HRegionLocation loc) Create a newRegionLocations
based on the givenoldLocs
, and replace the location for the givenreplicaId
with the givenloc
.(package private) static void
updateCachedLocationOnError
(HRegionLocation loc, Throwable exception, Function<HRegionLocation, HRegionLocation> cachedLocationSupplier, Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache, MetricsConnection metrics)
-
Field Details
-
LOG
-
-
Constructor Details
-
AsyncRegionLocatorHelper
private AsyncRegionLocatorHelper()
-
-
Method Details
-
canUpdateOnError
-
updateCachedLocationOnError
static void updateCachedLocationOnError(HRegionLocation loc, Throwable exception, Function<HRegionLocation, HRegionLocation> cachedLocationSupplier, Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache, MetricsConnection metrics) -
createRegionLocations
-
replaceRegionLocation
Create a newRegionLocations
based on the givenoldLocs
, and replace the location for the givenreplicaId
with the givenloc
. All theRegionLocations
in async locator related class are immutable because we want to access them concurrently, so here we need to create a new one, instead of callingRegionLocations.updateLocation(HRegionLocation, boolean, boolean)
. -
removeRegionLocation
Create a newRegionLocations
based on the givenoldLocs
, and remove the location for the givenreplicaId
. All theRegionLocations
in async locator related class are immutable because we want to access them concurrently, so here we need to create a new one, instead of callingRegionLocations.remove(int)
. -
isGood
-