use of org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.QueryPlanStatusRequestProto in project hadoop by apache.
the class ClientDatanodeProtocolTranslatorPB method queryDiskBalancerPlan.
/**
* Gets the status of an executing diskbalancer Plan.
*/
@Override
public DiskBalancerWorkStatus queryDiskBalancerPlan() throws IOException {
try {
QueryPlanStatusRequestProto request = QueryPlanStatusRequestProto.newBuilder().build();
QueryPlanStatusResponseProto response = rpcProxy.queryDiskBalancerPlan(NULL_CONTROLLER, request);
DiskBalancerWorkStatus.Result result = Result.NO_PLAN;
if (response.hasResult()) {
result = DiskBalancerWorkStatus.Result.values()[response.getResult()];
}
return new DiskBalancerWorkStatus(result, response.hasPlanID() ? response.getPlanID() : null, response.hasPlanFile() ? response.getPlanFile() : null, response.hasCurrentStatus() ? response.getCurrentStatus() : null);
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
Aggregations