Search in sources :

Example 11 with DatanodeStorageReport

use of org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport in project SSM by Intel-bigdata.

the class DatanodeStorageReportProcTask method getDNStorageReports.

/**
 * Get live datanode storage reports and then build the network topology.
 * @return
 * @throws IOException
 */
public List<DatanodeStorageReport> getDNStorageReports() throws IOException {
    final DatanodeStorageReport[] reports = client.getDatanodeStorageReport(DatanodeReportType.LIVE);
    final List<DatanodeStorageReport> trimmed = new ArrayList<DatanodeStorageReport>();
    // over-utilized, above-average, below-average and under-utilized.
    for (DatanodeStorageReport r : DFSUtil.shuffle(reports)) {
        final DatanodeInfo datanode = r.getDatanodeInfo();
        trimmed.add(r);
    }
    return trimmed;
}
Also used : DatanodeInfo(org.apache.hadoop.hdfs.protocol.DatanodeInfo) DatanodeStorageReport(org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport) ArrayList(java.util.ArrayList)

Aggregations

DatanodeStorageReport (org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport)11 DatanodeInfo (org.apache.hadoop.hdfs.protocol.DatanodeInfo)4 StorageType (org.apache.hadoop.fs.StorageType)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 StorageGroup (org.apache.hadoop.hdfs.server.balancer.Dispatcher.DDatanode.StorageGroup)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Configuration (org.apache.hadoop.conf.Configuration)1 DatanodeInfoBuilder (org.apache.hadoop.hdfs.protocol.DatanodeInfo.DatanodeInfoBuilder)1 DatanodeInfoWithStorage (org.apache.hadoop.hdfs.protocol.DatanodeInfoWithStorage)1 ExtendedBlock (org.apache.hadoop.hdfs.protocol.ExtendedBlock)1 LocatedBlock (org.apache.hadoop.hdfs.protocol.LocatedBlock)1 Dispatcher (org.apache.hadoop.hdfs.server.balancer.Dispatcher)1 DDatanode (org.apache.hadoop.hdfs.server.balancer.Dispatcher.DDatanode)1 Source (org.apache.hadoop.hdfs.server.balancer.Dispatcher.Source)1 DatanodeDescriptor (org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor)1 DatanodeManager (org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager)1