@InterfaceAudience.Private class AsyncMetaRegionLocator extends Object
Modifier and Type | Field and Description |
---|---|
private AtomicReference<RegionLocations> |
metaRegionLocations |
private AtomicReference<CompletableFuture<RegionLocations>> |
metaRelocateFuture |
private ConnectionRegistry |
registry |
Constructor and Description |
---|
AsyncMetaRegionLocator(ConnectionRegistry registry) |
Modifier and Type | Method and Description |
---|---|
private void |
addLocationToCache(HRegionLocation loc) |
(package private) void |
clearCache() |
(package private) void |
clearCache(ServerName serverName) |
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 final ConnectionRegistry registry
private final AtomicReference<RegionLocations> metaRegionLocations
private final AtomicReference<CompletableFuture<RegionLocations>> metaRelocateFuture
AsyncMetaRegionLocator(ConnectionRegistry 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()
void clearCache(ServerName serverName)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.