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