use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.RecommissionNodesResponseProto in project ozone by apache.
the class StorageContainerLocationProtocolServerSideTranslatorPB method recommissionNodes.
public RecommissionNodesResponseProto recommissionNodes(RecommissionNodesRequestProto request) throws IOException {
List<DatanodeAdminError> errors = impl.recommissionNodes(request.getHostsList());
RecommissionNodesResponseProto.Builder response = RecommissionNodesResponseProto.newBuilder();
for (DatanodeAdminError e : errors) {
DatanodeAdminErrorResponseProto.Builder error = DatanodeAdminErrorResponseProto.newBuilder();
error.setHost(e.getHostname());
error.setError(e.getError());
response.addFailedHosts(error);
}
return response.build();
}
use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.RecommissionNodesResponseProto 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