@InterfaceAudience.Private class AsyncMetaRegionLocator extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private AtomicReference<RegionLocations> |
metaRegionLocations |
private AtomicReference<CompletableFuture<RegionLocations>> |
metaRelocateFuture |
private AsyncRegistry |
registry |
Constructor and Description |
---|
AsyncMetaRegionLocator(AsyncRegistry registry) |
Modifier and Type | Method and Description |
---|---|
private void |
addLocationToCache(HRegionLocation loc) |
(package private) void |
clearCache() |
private HRegionLocation |
getCacheLocation(HRegionLocation loc) |
(package private) CompletableFuture<RegionLocations> |
getRegionLocations(int replicaId,
boolean reload)
Get the region locations for meta region.
|
private void |
removeLocationFromCache(HRegionLocation loc) |
(package private) void |
updateCachedLocationOnError(HRegionLocation loc,
Throwable exception) |
private static final org.slf4j.Logger LOG
private final AsyncRegistry registry
private final AtomicReference<RegionLocations> metaRegionLocations
private final AtomicReference<CompletableFuture<RegionLocations>> metaRelocateFuture
AsyncMetaRegionLocator(AsyncRegistry registry)
CompletableFuture<RegionLocations> getRegionLocations(int replicaId, boolean reload)
replicaId
parameter is important. If the region replication config for meta
region is changed, then the cached region locations may not have the locations for new
replicas. If we do not check the location for the given replica, we will always return the
cached region locations and cause an infinite loop.private HRegionLocation getCacheLocation(HRegionLocation loc)
private void addLocationToCache(HRegionLocation loc)
private void removeLocationFromCache(HRegionLocation loc)
void updateCachedLocationOnError(HRegionLocation loc, Throwable exception)
void clearCache()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.