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);
}
}
}
Aggregations