hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
public static ReadChunkResponseProto readChunk(XceiverClientSpi xceiverClient,
      ChunkInfo chunk, String key, String traceID)
      throws IOException {
    ReadChunkRequestProto.Builder readChunkRequest = ReadChunkRequestProto
        .newBuilder()
        .setPipeline(xceiverClient.getPipeline().getProtobufMessage())
        .setKeyName(key)
        .setChunkData(chunk);
    String id = xceiverClient.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto request = ContainerCommandRequestProto
        .newBuilder()
        .setCmdType(Type.ReadChunk)
        .setTraceID(traceID)
        .setDatanodeUuid(id)
        .setReadChunk(readChunkRequest)
        .build();
    ContainerCommandResponseProto response = xceiverClient.sendCommand(request);
    validateContainerResponse(response);
    return response.getReadChunk();
  }
/**
   * Calls the container protocol to read a chunk.
   *
   * @param xceiverClient client to perform call
   * @param chunk information about chunk to read
   * @param key the key name
   * @param traceID container protocol call args
   * @return container protocol read chunk response
   * @throws IOException if there is an I/O error while performing the call
   */
Calls the container protocol to read a chunk.
Calls the container protocol to read a chunk .
public static ReadChunkResponseProto readChunk(XceiverClientSpi xceiverClient,
      ChunkInfo chunk, String key, String traceID)
      throws IOException {
    ReadChunkRequestProto.Builder readChunkRequest = ReadChunkRequestProto
        .newBuilder()
        .setPipeline(xceiverClient.getPipeline().getProtobufMessage())
        .setKeyName(key)
        .setChunkData(chunk);
    String id = xceiverClient.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto request = ContainerCommandRequestProto
        .newBuilder()
        .setCmdType(Type.ReadChunk)
        .setTraceID(traceID)
        .setDatanodeUuid(id)
        .setReadChunk(readChunkRequest)
        .build();
    ContainerCommandResponseProto response = xceiverClient.sendCommand(request);
    validateContainerResponse(response);
    return response.getReadChunk();
  }
public static ReadChunkResponseProto readChunk ( XceiverClientSpi xceiverClient , ChunkInfo chunk , String key , String traceID ) throws IOException { ReadChunkRequestProto . Builder readChunkRequest = ReadChunkRequestProto . newBuilder ( ) . setPipeline ( xceiverClient . getPipeline ( ) . getProtobufMessage ( ) ) . setKeyName ( key ) . setChunkData ( chunk ) ; String id = xceiverClient . getPipeline ( ) . getLeader ( ) . getUuidString ( ) ; ContainerCommandRequestProto request = ContainerCommandRequestProto . newBuilder ( ) . setCmdType ( Type . ReadChunk ) . setTraceID ( traceID ) . setDatanodeUuid ( id ) . setReadChunk ( readChunkRequest ) . build ( ) ; ContainerCommandResponseProto response = xceiverClient . sendCommand ( request ) ; validateContainerResponse ( response ) ; return response . getReadChunk ( ) ; }
Calls the container protocol to read a chunk.
Calls the container protocol to read a chunk .