use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.DatanodeAdminErrorResponseProto in project ozone by apache.
the class StorageContainerLocationProtocolClientSideTranslatorPB method startMaintenanceNodes.
/**
* Attempts to put the list of nodes into maintenance mode.
*
* @param nodes The list of hostnames or hostname:ports to put into
* maintenance
* @param endInHours A number of hours from now where the nodes will be taken
* out of maintenance automatically. Passing zero will
* allow the nodes to stay in maintenance indefinitely
* @throws IOException
*/
@Override
public List<DatanodeAdminError> startMaintenanceNodes(List<String> nodes, int endInHours) throws IOException {
Preconditions.checkNotNull(nodes);
StartMaintenanceNodesRequestProto request = StartMaintenanceNodesRequestProto.newBuilder().addAllHosts(nodes).setEndInHours(endInHours).build();
StartMaintenanceNodesResponseProto response = submitRequest(Type.StartMaintenanceNodes, builder -> builder.setStartMaintenanceNodesRequest(request)).getStartMaintenanceNodesResponse();
List<DatanodeAdminError> errors = new ArrayList<>();
for (DatanodeAdminErrorResponseProto e : response.getFailedHostsList()) {
errors.add(new DatanodeAdminError(e.getHost(), e.getError()));
}
return errors;
}
use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.DatanodeAdminErrorResponseProto 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;
}
use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.DatanodeAdminErrorResponseProto 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