hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
public static ReadContainerResponseProto readContainer(
      XceiverClientSpi client, String containerName,
      String traceID) throws IOException {
    ReadContainerRequestProto.Builder readRequest =
        ReadContainerRequestProto.newBuilder();
    readRequest.setName(containerName);
    readRequest.setPipeline(client.getPipeline().getProtobufMessage());
    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto.Builder request =
        ContainerCommandRequestProto.newBuilder();
    request.setCmdType(Type.ReadContainer);
    request.setReadContainer(readRequest);
    request.setDatanodeUuid(id);
    request.setTraceID(traceID);
    ContainerCommandResponseProto response =
        client.sendCommand(request.build());
    validateContainerResponse(response);
    return response.getReadContainer();
  }
/**
   * readContainer call that gets meta data from an existing container.
   *
   * @param client - client
   * @param traceID - trace ID
   * @throws IOException
   */
readContainer call that gets meta data from an existing container.
@param client - client
@param traceID - trace ID
@throws IOException
readContainer call that gets meta data from an existing container . @param client - client @param traceID - trace ID @throws IOException
public static ReadContainerResponseProto readContainer(
      XceiverClientSpi client, String containerName,
      String traceID) throws IOException {
    ReadContainerRequestProto.Builder readRequest =
        ReadContainerRequestProto.newBuilder();
    readRequest.setName(containerName);
    readRequest.setPipeline(client.getPipeline().getProtobufMessage());
    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto.Builder request =
        ContainerCommandRequestProto.newBuilder();
    request.setCmdType(Type.ReadContainer);
    request.setReadContainer(readRequest);
    request.setDatanodeUuid(id);
    request.setTraceID(traceID);
    ContainerCommandResponseProto response =
        client.sendCommand(request.build());
    validateContainerResponse(response);
    return response.getReadContainer();
  }
public static ReadContainerResponseProto readContainer ( XceiverClientSpi client , String containerName , String traceID ) throws IOException { ReadContainerRequestProto . Builder readRequest = ReadContainerRequestProto . newBuilder ( ) ; readRequest . setName ( containerName ) ; readRequest . setPipeline ( client . getPipeline ( ) . getProtobufMessage ( ) ) ; String id = client . getPipeline ( ) . getLeader ( ) . getUuidString ( ) ; ContainerCommandRequestProto . Builder request = ContainerCommandRequestProto . newBuilder ( ) ; request . setCmdType ( Type . ReadContainer ) ; request . setReadContainer ( readRequest ) ; request . setDatanodeUuid ( id ) ; request . setTraceID ( traceID ) ; ContainerCommandResponseProto response = client . sendCommand ( request . build ( ) ) ; validateContainerResponse ( response ) ; return response . getReadContainer ( ) ; }
readContainer call that gets meta data from an existing container.
readContainer call that gets meta data from an existing container .