use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RecoverTrashResponse in project ozone by apache.
the class OzoneManagerProtocolClientSideTranslatorPB method recoverTrash.
@Override
public boolean recoverTrash(String volumeName, String bucketName, String keyName, String destinationBucket) throws IOException {
Preconditions.checkArgument(Strings.isNullOrEmpty(volumeName), "The volume name cannot be null or empty. " + "Please enter a valid volume name.");
Preconditions.checkArgument(Strings.isNullOrEmpty(bucketName), "The bucket name cannot be null or empty. " + "Please enter a valid bucket name.");
Preconditions.checkArgument(Strings.isNullOrEmpty(keyName), "The key name cannot be null or empty. " + "Please enter a valid key name.");
Preconditions.checkArgument(Strings.isNullOrEmpty(destinationBucket), "The destination bucket name cannot be null or empty. " + "Please enter a valid destination bucket name.");
RecoverTrashRequest.Builder req = RecoverTrashRequest.newBuilder().setVolumeName(volumeName).setBucketName(bucketName).setKeyName(keyName).setDestinationBucket(destinationBucket);
OMRequest omRequest = createOMRequest(Type.RecoverTrash).setRecoverTrashRequest(req).build();
RecoverTrashResponse recoverResponse = handleError(submitRequest(omRequest)).getRecoverTrashResponse();
return recoverResponse.getResponse();
}
Aggregations