Search in sources :

Example 1 with ScmContainerLocationRequest

use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationRequest in project ozone by apache.

the class StorageContainerLocationProtocolClientSideTranslatorPB method submitRequest.

/**
 * Helper method to wrap the request and send the message.
 */
private ScmContainerLocationResponse submitRequest(StorageContainerLocationProtocolProtos.Type type, Consumer<Builder> builderConsumer) throws IOException {
    final ScmContainerLocationResponse response;
    try {
        Builder builder = ScmContainerLocationRequest.newBuilder().setCmdType(type).setVersion(CURRENT_VERSION).setTraceID(TracingUtil.exportCurrentSpan());
        builderConsumer.accept(builder);
        ScmContainerLocationRequest wrapper = builder.build();
        response = submitRpcRequest(wrapper);
    } catch (ServiceException ex) {
        throw ProtobufHelper.getRemoteException(ex);
    }
    return response;
}
Also used : ScmContainerLocationResponse(org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationResponse) ServiceException(com.google.protobuf.ServiceException) Builder(org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationRequest.Builder) ScmContainerLocationRequest(org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationRequest)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ScmContainerLocationRequest (org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationRequest)1 Builder (org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationRequest.Builder)1 ScmContainerLocationResponse (org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationResponse)1