hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
public static void createContainer(XceiverClientSpi client, String traceID)
      throws IOException {
    ContainerProtos.CreateContainerRequestProto.Builder createRequest =
        ContainerProtos.CreateContainerRequestProto
            .newBuilder();
    ContainerProtos.ContainerData.Builder containerData = ContainerProtos
        .ContainerData.newBuilder();
    containerData.setName(client.getPipeline().getContainerName());
    createRequest.setPipeline(client.getPipeline().getProtobufMessage());
    createRequest.setContainerData(containerData.build());

    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto.Builder request =
        ContainerCommandRequestProto.newBuilder();
    request.setCmdType(ContainerProtos.Type.CreateContainer);
    request.setCreateContainer(createRequest);
    request.setDatanodeUuid(id);
    request.setTraceID(traceID);
    ContainerCommandResponseProto response = client.sendCommand(
        request.build());
    validateContainerResponse(response);
  }
/**
   * createContainer call that creates a container on the datanode.
   * @param client  - client
   * @param traceID - traceID
   * @throws IOException
   */
createContainer call that creates a container on the datanode.
@param client  - client
@param traceID - traceID
@throws IOException
createContainer call that creates a container on the datanode . @param client - client @param traceID - traceID @throws IOException
public static void createContainer(XceiverClientSpi client, String traceID)
      throws IOException {
    ContainerProtos.CreateContainerRequestProto.Builder createRequest =
        ContainerProtos.CreateContainerRequestProto
            .newBuilder();
    ContainerProtos.ContainerData.Builder containerData = ContainerProtos
        .ContainerData.newBuilder();
    containerData.setName(client.getPipeline().getContainerName());
    createRequest.setPipeline(client.getPipeline().getProtobufMessage());
    createRequest.setContainerData(containerData.build());
    String id = client.getPipeline().getLeader().getUuidString();
    ContainerCommandRequestProto.Builder request =
        ContainerCommandRequestProto.newBuilder();
    request.setCmdType(ContainerProtos.Type.CreateContainer);
    request.setCreateContainer(createRequest);
    request.setDatanodeUuid(id);
    request.setTraceID(traceID);
    ContainerCommandResponseProto response = client.sendCommand(
        request.build());
    validateContainerResponse(response);
  }
public static void createContainer ( XceiverClientSpi client , String traceID ) throws IOException { ContainerProtos . CreateContainerRequestProto . Builder createRequest = ContainerProtos . CreateContainerRequestProto . newBuilder ( ) ; ContainerProtos . ContainerData . Builder containerData = ContainerProtos . ContainerData . newBuilder ( ) ; containerData . setName ( client . getPipeline ( ) . getContainerName ( ) ) ; createRequest . setPipeline ( client . getPipeline ( ) . getProtobufMessage ( ) ) ; createRequest . setContainerData ( containerData . build ( ) ) ; String id = client . getPipeline ( ) . getLeader ( ) . getUuidString ( ) ; ContainerCommandRequestProto . Builder request = ContainerCommandRequestProto . newBuilder ( ) ; request . setCmdType ( ContainerProtos . Type . CreateContainer ) ; request . setCreateContainer ( createRequest ) ; request . setDatanodeUuid ( id ) ; request . setTraceID ( traceID ) ; ContainerCommandResponseProto response = client . sendCommand ( request . build ( ) ) ; validateContainerResponse ( response ) ; }
createContainer call that creates a container on the datanode.
createContainer call that creates a container on the datanode .