public TSStatus createRegionGroups(
      final TConsensusGroupType consensusGroupType,
      final CreateRegionGroupsPlan createRegionGroupsPlan) {
    final CreateRegionGroupsProcedure procedure =
        new CreateRegionGroupsProcedure(consensusGroupType, createRegionGroupsPlan);
    executor.submitProcedure(procedure);
    final TSStatus status = waitingProcedureFinished(procedure);
    if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
      return status;
    } else {
      return new TSStatus(TSStatusCode.CREATE_REGION_ERROR.getStatusCode())
          .setMessage(status.getMessage());
    }
  }
Generate {@link CreateRegionGroupsProcedure} and wait until it finished.

@return {@link TSStatusCode#SUCCESS_STATUS} if all RegionGroups have been created successfully,
    {@link TSStatusCode#CREATE_REGION_ERROR} otherwise
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java