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;
}
Aggregations