public static List<RegionInfo> createRegions(final ThreadPoolExecutor exec,
    final Configuration conf, final Path rootDir, final TableDescriptor tableDescriptor,
    final RegionInfo[] newRegions, final RegionFillTask task) throws IOException {
    if (newRegions == null) return null;
    int regionNumber = newRegions.length;
    CompletionService<RegionInfo> completionService = new ExecutorCompletionService<>(exec);
    List<RegionInfo> regionInfos = new ArrayList<>();
    for (final RegionInfo newRegion : newRegions) {
      completionService.submit(new Callable<RegionInfo>() {
        @Override
        public RegionInfo call() throws IOException {
          return createRegion(conf, rootDir, tableDescriptor, newRegion, task);
        }
      });
    }
    try {
      // wait for all regions to finish creation
      for (int i = 0; i < regionNumber; i++) {
        regionInfos.add(completionService.take().get());
      }
    } catch (InterruptedException e) {
      LOG.error("Caught " + e + " during region creation");
      throw new InterruptedIOException(e.getMessage());
    } catch (ExecutionException e) {
      throw new IOException(e);
    }
    return regionInfos;
  }
Create new set of regions on the specified file-system. NOTE: that you should add the regions
to hbase:meta after this operation.
@param exec            Thread Pool Executor
@param conf            {@link Configuration}
@param rootDir         Root directory for HBase instance
@param tableDescriptor description of the table
@param newRegions      {@link RegionInfo} that describes the regions to create
@param task            {@link RegionFillTask} custom code to populate region after creation
hbase-server/src/main/java/org/apache/hadoop/hbase/util/ModifyRegionUtils.java