Search in sources :

Example 1 with GetContainerReplicasRequestProto

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

the class StorageContainerLocationProtocolClientSideTranslatorPB method getContainerReplicas.

/**
 * {@inheritDoc}
 */
@Override
public List<HddsProtos.SCMContainerReplicaProto> getContainerReplicas(long containerID) throws IOException {
    Preconditions.checkState(containerID >= 0, "Container ID cannot be negative");
    GetContainerReplicasRequestProto request = GetContainerReplicasRequestProto.newBuilder().setTraceID(TracingUtil.exportCurrentSpan()).setContainerID(containerID).build();
    ScmContainerLocationResponse response = submitRequest(Type.GetContainerReplicas, (builder) -> builder.setGetContainerReplicasRequest(request));
    return response.getGetContainerReplicasResponse().getContainerReplicaList();
}
Also used : ScmContainerLocationResponse(org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationResponse) GetContainerReplicasRequestProto(org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerReplicasRequestProto)

Aggregations

GetContainerReplicasRequestProto (org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerReplicasRequestProto)1 ScmContainerLocationResponse (org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ScmContainerLocationResponse)1