use of org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerWithPipelineBatchRequestProto in project ozone by apache.
the class StorageContainerLocationProtocolClientSideTranslatorPB method getContainerWithPipelineBatch.
/**
* {@inheritDoc}
*/
@Override
public List<ContainerWithPipeline> getContainerWithPipelineBatch(List<Long> containerIDs) throws IOException {
for (Long containerID : containerIDs) {
Preconditions.checkState(containerID >= 0, "Container ID cannot be negative");
}
GetContainerWithPipelineBatchRequestProto request = GetContainerWithPipelineBatchRequestProto.newBuilder().setTraceID(TracingUtil.exportCurrentSpan()).addAllContainerIDs(containerIDs).build();
ScmContainerLocationResponse response = submitRequest(Type.GetContainerWithPipelineBatch, (builder) -> builder.setGetContainerWithPipelineBatchRequest(request));
List<HddsProtos.ContainerWithPipeline> protoCps = response.getGetContainerWithPipelineBatchResponse().getContainerWithPipelinesList();
List<ContainerWithPipeline> cps = new ArrayList<>();
for (HddsProtos.ContainerWithPipeline cp : protoCps) {
cps.add(ContainerWithPipeline.fromProtobuf(cp));
}
return cps;
}
Aggregations