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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleancanUpdateOnError(HRegionLocation loc, HRegionLocation oldLoc) (package private) static RegionLocations(package private) static booleanisGood(RegionLocations locs, int replicaId) (package private) static RegionLocationsremoveRegionLocation(RegionLocations oldLocs, int replicaId) Create a newRegionLocationsbased on the givenoldLocs, and remove the location for the givenreplicaId.(package private) static RegionLocationsreplaceRegionLocation(RegionLocations oldLocs, HRegionLocation loc) Create a newRegionLocationsbased on the givenoldLocs, and replace the location for the givenreplicaIdwith the givenloc.(package private) static voidupdateCachedLocationOnError(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 newRegionLocationsbased on the givenoldLocs, and replace the location for the givenreplicaIdwith the givenloc. All theRegionLocationsin 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 newRegionLocationsbased on the givenoldLocs, and remove the location for the givenreplicaId. All theRegionLocationsin 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
-