Search in sources :

Example 1 with Dispatcher

use of org.apache.hadoop.hdfs.server.balancer.Dispatcher in project SSM by Intel-bigdata.

the class Mover method init.

@VisibleForTesting
void init() throws IOException {
    final List<DatanodeStorageReport> reports = dispatcher.init();
    for (DatanodeStorageReport r : reports) {
        final Dispatcher.DDatanode dn = dispatcher.newDatanode(r.getDatanodeInfo());
        for (StorageType t : StorageType.getMovableTypes()) {
            final Dispatcher.Source source = dn.addSource(t, Long.MAX_VALUE, dispatcher);
            final long maxRemaining = getMaxRemaining(r, t);
            final Dispatcher.DDatanode.StorageGroup target = maxRemaining > 0L ? dn.addTarget(t, maxRemaining) : null;
            storages.add(source, target);
        }
    }
}
Also used : StorageType(org.apache.hadoop.fs.StorageType) DatanodeStorageReport(org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport) Dispatcher(org.apache.hadoop.hdfs.server.balancer.Dispatcher) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 StorageType (org.apache.hadoop.fs.StorageType)1 Dispatcher (org.apache.hadoop.hdfs.server.balancer.Dispatcher)1 DatanodeStorageReport (org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport)1