@InterfaceAudience.Private class RegionLocationFinder extends Object
ServerName
's by the size of the store files they are holding for a
given region.Modifier and Type | Field and Description |
---|---|
private com.google.common.cache.LoadingCache<HRegionInfo,HDFSBlocksDistribution> |
cache |
private static long |
CACHE_TIME |
private org.apache.hadoop.conf.Configuration |
conf |
private com.google.common.util.concurrent.ListeningExecutorService |
executor |
private long |
lastFullRefresh |
private com.google.common.cache.CacheLoader<HRegionInfo,HDFSBlocksDistribution> |
loader |
private static org.apache.commons.logging.Log |
LOG |
private MasterServices |
services |
private ClusterStatus |
status |
Constructor and Description |
---|
RegionLocationFinder() |
Modifier and Type | Method and Description |
---|---|
private com.google.common.cache.LoadingCache<HRegionInfo,HDFSBlocksDistribution> |
createCache()
Create a cache for region to list of servers
|
HDFSBlocksDistribution |
getBlockDistribution(HRegionInfo hri) |
org.apache.hadoop.conf.Configuration |
getConf() |
protected HTableDescriptor |
getTableDescriptor(TableName tableName)
return HTableDescriptor for a given tableName
|
protected List<ServerName> |
getTopBlockLocations(HRegionInfo region) |
protected HDFSBlocksDistribution |
internalGetTopBlockLocation(HRegionInfo region)
Returns an ordered list of hosts that are hosting the blocks for this
region.
|
protected List<ServerName> |
mapHostNameToServerName(List<String> hosts)
Map hostname to ServerName, The output ServerName list will have the same
order as input hosts.
|
private boolean |
scheduleFullRefresh()
Refresh all the region locations.
|
void |
setClusterStatus(ClusterStatus status) |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setServices(MasterServices services) |
private static final org.apache.commons.logging.Log LOG
private static final long CACHE_TIME
private org.apache.hadoop.conf.Configuration conf
private volatile ClusterStatus status
private MasterServices services
private final com.google.common.util.concurrent.ListeningExecutorService executor
private long lastFullRefresh
private com.google.common.cache.CacheLoader<HRegionInfo,HDFSBlocksDistribution> loader
private com.google.common.cache.LoadingCache<HRegionInfo,HDFSBlocksDistribution> cache
private com.google.common.cache.LoadingCache<HRegionInfo,HDFSBlocksDistribution> createCache()
time
- time to cache the locationspublic org.apache.hadoop.conf.Configuration getConf()
public void setConf(org.apache.hadoop.conf.Configuration conf)
public void setServices(MasterServices services)
public void setClusterStatus(ClusterStatus status)
private boolean scheduleFullRefresh()
protected List<ServerName> getTopBlockLocations(HRegionInfo region)
protected HDFSBlocksDistribution internalGetTopBlockLocation(HRegionInfo region)
region
- regionprotected HTableDescriptor getTableDescriptor(TableName tableName) throws IOException
tableName
- the table nameIOException
protected List<ServerName> mapHostNameToServerName(List<String> hosts)
hosts
- the list of hostspublic HDFSBlocksDistribution getBlockDistribution(HRegionInfo hri)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.