|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.HDFSBlocksDistribution
@InterfaceAudience.Private public class HDFSBlocksDistribution
Data structure to describe the distribution of HDFS blocks amount hosts. Adding erroneous data will be ignored silently.
| Nested Class Summary | |
|---|---|
static class |
HDFSBlocksDistribution.HostAndWeight
Stores the hostname and weight for that hostname. |
| Constructor Summary | |
|---|---|
HDFSBlocksDistribution()
Constructor |
|
| Method Summary | |
|---|---|
void |
add(HDFSBlocksDistribution otherBlocksDistribution)
This will add the distribution from input to this object |
void |
addHostsAndBlockWeight(String[] hosts,
long weight)
add some weight to a list of hosts, update the value of unique block weight |
float |
getBlockLocalityIndex(String host)
return the locality index of a given host |
Map<String,HDFSBlocksDistribution.HostAndWeight> |
getHostAndWeights()
|
List<String> |
getTopHosts()
return the sorted list of hosts in terms of their weights |
long |
getUniqueBlocksTotalWeight()
|
long |
getWeight(String host)
return the weight for a specific host, that will be the total bytes of all blocks on the host |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HDFSBlocksDistribution()
| Method Detail |
|---|
public String toString()
toString in class ObjectObject.toString()
public void addHostsAndBlockWeight(String[] hosts,
long weight)
hosts - the list of the hostweight - the weightpublic Map<String,HDFSBlocksDistribution.HostAndWeight> getHostAndWeights()
public long getWeight(String host)
host - the host name
public long getUniqueBlocksTotalWeight()
public float getBlockLocalityIndex(String host)
host - the host name
public void add(HDFSBlocksDistribution otherBlocksDistribution)
otherBlocksDistribution - the other hdfs blocks distributionpublic List<String> getTopHosts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||