public ScmContainerLocationResponse submitRequest()

in hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/StorageContainerLocationProtocolServerSideTranslatorPB.java [207:270]


  public ScmContainerLocationResponse submitRequest(RpcController controller,
      ScmContainerLocationRequest request) throws ServiceException {
    // not leader or not belong to admin command.
    if (!scm.checkLeader()
        && !ADMIN_COMMAND_TYPE.contains(request.getCmdType())) {
      RatisUtil.checkRatisException(
          scm.getScmHAManager().getRatisServer().triggerNotLeaderException(),
          scm.getClientRpcPort(), scm.getScmId(), scm.getHostname(), ROLE_TYPE);
    }
    // After the request interceptor (now validator) framework is extended to
    // this server interface, this should be removed and solved via new
    // annotated interceptors.
    boolean checkResponseForECRepConfig = false;
    if (request.getVersion() <
        ClientVersion.ERASURE_CODING_SUPPORT.toProtoValue()) {
      if (request.getCmdType() == GetContainer
          || request.getCmdType() == ListContainer
          || request.getCmdType() == GetContainerWithPipeline
          || request.getCmdType() == GetContainerWithPipelineBatch
          || request.getCmdType() == GetExistContainerWithPipelinesInBatch
          || request.getCmdType() == ListPipelines
          || request.getCmdType() == GetPipeline) {

        checkResponseForECRepConfig = true;
      }
    }
    ScmContainerLocationResponse response = dispatcher
        .processRequest(request, this::processRequest, request.getCmdType(),
            request.getTraceID());
    if (checkResponseForECRepConfig) {
      try {
        switch (response.getCmdType()) {
        case GetContainer:
          disallowECReplicationConfigInGetContainerResponse(response);
          break;
        case ListContainer:
          disallowECReplicationConfigInListContainerResponse(response);
          break;
        case GetContainerWithPipeline:
          disallowECReplicationConfigInGetContainerWithPipelineResponse(
              response);
          break;
        case GetContainerWithPipelineBatch:
          disallowECReplicationConfigInGetContainerWithPipelineBatchResponse(
              response);
          break;
        case GetExistContainerWithPipelinesInBatch:
          disallowECReplicationConfigInGetExistContainerWithPipelineBatchResp(
              response);
          break;
        case ListPipelines:
          disallowECReplicationConfigInListPipelinesResponse(response);
          break;
        case GetPipeline:
          disallowECReplicationConfigInGetPipelineResponse(response);
          break;
        default:
        }
      } catch (SCMException e) {
        throw new ServiceException(e);
      }
    }
    return response;
  }