hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
public static GetSmallFileResponseProto readSmallFile(XceiverClientSpi client,
      String containerName, String key, String traceID) throws IOException {
    KeyData containerKeyData = KeyData
        .newBuilder()
        .setContainerName(containerName)
        .setName(key).build();

    GetKeyRequestProto.Builder getKey = GetKeyRequestProto
        .newBuilder()
        .setPipeline(client.getPipeline().getProtobufMessage())
        .setKeyData(containerKeyData);
    ContainerProtos.GetSmallFileRequestProto getSmallFileRequest =
        GetSmallFileRequestProto
            .newBuilder().setKey(getKey)
            .build();
    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto request = ContainerCommandRequestProto
        .newBuilder()
        .setCmdType(Type.GetSmallFile)
        .setTraceID(traceID)
        .setDatanodeUuid(id)
        .setGetSmallFile(getSmallFileRequest)
        .build();
    ContainerCommandResponseProto response = client.sendCommand(request);
    validateContainerResponse(response);
    return response.getGetSmallFile();
  }
/**
   * Reads the data given the container name and key.
   *
   * @param client
   * @param containerName - name of the container
   * @param key - key
   * @param traceID - trace ID
   * @return GetSmallFileResponseProto
   * @throws IOException
   */
Reads the data given the container name and key.
Reads the data given the container name and key .
public static GetSmallFileResponseProto readSmallFile(XceiverClientSpi client,
      String containerName, String key, String traceID) throws IOException {
    KeyData containerKeyData = KeyData
        .newBuilder()
        .setContainerName(containerName)
        .setName(key).build();
    GetKeyRequestProto.Builder getKey = GetKeyRequestProto
        .newBuilder()
        .setPipeline(client.getPipeline().getProtobufMessage())
        .setKeyData(containerKeyData);
    ContainerProtos.GetSmallFileRequestProto getSmallFileRequest =
        GetSmallFileRequestProto
            .newBuilder().setKey(getKey)
            .build();
    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto request = ContainerCommandRequestProto
        .newBuilder()
        .setCmdType(Type.GetSmallFile)
        .setTraceID(traceID)
        .setDatanodeUuid(id)
        .setGetSmallFile(getSmallFileRequest)
        .build();
    ContainerCommandResponseProto response = client.sendCommand(request);
    validateContainerResponse(response);
    return response.getGetSmallFile();
  }
public static GetSmallFileResponseProto readSmallFile ( XceiverClientSpi client , String containerName , String key , String traceID ) throws IOException { KeyData containerKeyData = KeyData . newBuilder ( ) . setContainerName ( containerName ) . setName ( key ) . build ( ) ; GetKeyRequestProto . Builder getKey = GetKeyRequestProto . newBuilder ( ) . setPipeline ( client . getPipeline ( ) . getProtobufMessage ( ) ) . setKeyData ( containerKeyData ) ; ContainerProtos . GetSmallFileRequestProto getSmallFileRequest = GetSmallFileRequestProto . newBuilder ( ) . setKey ( getKey ) . build ( ) ; String id = client . getPipeline ( ) . getLeader ( ) . getUuidString ( ) ; ContainerCommandRequestProto request = ContainerCommandRequestProto . newBuilder ( ) . setCmdType ( Type . GetSmallFile ) . setTraceID ( traceID ) . setDatanodeUuid ( id ) . setGetSmallFile ( getSmallFileRequest ) . build ( ) ; ContainerCommandResponseProto response = client . sendCommand ( request ) ; validateContainerResponse ( response ) ; return response . getGetSmallFile ( ) ; }
Reads the data given the container name and key.
Reads the data given the container name and key .