use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.DecommissionNodesRequestProto in project ozone by apache.
the class StorageContainerLocationProtocolClientSideTranslatorPB method decommissionNodes.
/**
* Attempts to decommission the list of nodes.
* @param nodes The list of hostnames or hostname:ports to decommission
* @throws IOException
*/
@Override
public List<DatanodeAdminError> decommissionNodes(List<String> nodes) throws IOException {
Preconditions.checkNotNull(nodes);
DecommissionNodesRequestProto request = DecommissionNodesRequestProto.newBuilder().addAllHosts(nodes).build();
DecommissionNodesResponseProto response = submitRequest(Type.DecommissionNodes, builder -> builder.setDecommissionNodesRequest(request)).getDecommissionNodesResponse();
List<DatanodeAdminError> errors = new ArrayList<>();
for (DatanodeAdminErrorResponseProto e : response.getFailedHostsList()) {
errors.add(new DatanodeAdminError(e.getHost(), e.getError()));
}
return errors;
}
Aggregations