@InterfaceAudience.Private class RegionHDFSBlockLocationFinder extends org.apache.hadoop.conf.Configured
ServerName
's by the
size of the store files they are holding for a given region.Modifier and Type | Field and Description |
---|---|
private org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> |
cache |
private static long |
CACHE_TIME |
private static HDFSBlocksDistribution |
EMPTY_BLOCK_DISTRIBUTION |
private static float |
EPSILON |
private org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListeningExecutorService |
executor |
private long |
lastFullRefresh |
private org.apache.hbase.thirdparty.com.google.common.cache.CacheLoader<RegionInfo,HDFSBlocksDistribution> |
loader |
private static org.slf4j.Logger |
LOG |
private ClusterInfoProvider |
provider |
private ClusterMetrics |
status |
Constructor and Description |
---|
RegionHDFSBlockLocationFinder() |
Modifier and Type | Method and Description |
---|---|
private org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListenableFuture<HDFSBlocksDistribution> |
asyncGetBlockDistribution(RegionInfo hri) |
private org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> |
createCache()
Create a cache for region to list of servers
|
(package private) HDFSBlocksDistribution |
getBlockDistribution(RegionInfo hri) |
(package private) org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> |
getCache() |
private TableDescriptor |
getDescriptor(TableName tableName)
return TableDescriptor for a given tableName
|
private float |
getOldLocality(ServerName newServer,
byte[] regionName,
Map<ServerName,ServerMetrics> oldServers) |
(package private) List<ServerName> |
getTopBlockLocations(RegionInfo region) |
private HDFSBlocksDistribution |
internalGetTopBlockLocation(RegionInfo region)
Returns an ordered list of hosts that are hosting the blocks for this region.
|
(package private) List<ServerName> |
mapHostNameToServerName(List<String> hosts)
Map hostname to ServerName, The output ServerName list will have the same order as input hosts.
|
(package private) void |
refreshAndWait(Collection<RegionInfo> hris) |
private void |
refreshLocalityChangedRegions(ClusterMetrics oldStatus,
ClusterMetrics newStatus)
If locality for a region has changed, that pretty certainly means our cache is out of date.
|
private boolean |
scheduleFullRefresh()
Refresh all the region locations.
|
(package private) void |
setClusterInfoProvider(ClusterInfoProvider provider) |
(package private) void |
setClusterMetrics(ClusterMetrics status) |
private static final org.slf4j.Logger LOG
private static final long CACHE_TIME
private static final float EPSILON
private static final HDFSBlocksDistribution EMPTY_BLOCK_DISTRIBUTION
private volatile ClusterMetrics status
private volatile ClusterInfoProvider provider
private final org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListeningExecutorService executor
private long lastFullRefresh
private org.apache.hbase.thirdparty.com.google.common.cache.CacheLoader<RegionInfo,HDFSBlocksDistribution> loader
private org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> cache
RegionHDFSBlockLocationFinder()
private org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> createCache()
void setClusterInfoProvider(ClusterInfoProvider provider)
void setClusterMetrics(ClusterMetrics status)
private void refreshLocalityChangedRegions(ClusterMetrics oldStatus, ClusterMetrics newStatus)
private float getOldLocality(ServerName newServer, byte[] regionName, Map<ServerName,ServerMetrics> oldServers)
private boolean scheduleFullRefresh()
List<ServerName> getTopBlockLocations(RegionInfo region)
private HDFSBlocksDistribution internalGetTopBlockLocation(RegionInfo region)
region
- regionprivate TableDescriptor getDescriptor(TableName tableName) throws IOException
tableName
- the table nameIOException
List<ServerName> mapHostNameToServerName(List<String> hosts)
hosts
- the list of hostsHDFSBlocksDistribution getBlockDistribution(RegionInfo hri)
private org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListenableFuture<HDFSBlocksDistribution> asyncGetBlockDistribution(RegionInfo hri)
void refreshAndWait(Collection<RegionInfo> hris)
org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<RegionInfo,HDFSBlocksDistribution> getCache()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.