@Override
    public byte[][] split(int numRegions) {
      Preconditions.checkArgument(Bytes.compareTo(lastRowBytes, firstRowBytes) > 0,
        "last row (%s) is configured less than first row (%s)", Bytes.toStringBinary(lastRowBytes),
        Bytes.toStringBinary(firstRowBytes));

      byte[][] splits = Bytes.split(firstRowBytes, lastRowBytes, true, numRegions - 1);
      Preconditions.checkState(splits != null,
        "Could not split region with given user input: " + this);

      // remove endpoints, which are included in the splits list

      return splits == null ? null : Arrays.copyOfRange(splits, 1, splits.length - 1);
    }
A SplitAlgorithm that divides the space of possible keys evenly. Useful when the keys are
approximately uniform random bytes (e.g. hashes). Rows are raw byte values in the range <b>00
=&gt; FF</b> and are right-padded with zeros to keep the same memcmp() order. This is the
natural algorithm to use for a byte[] environment and saves space, but is not necessarily the
easiest for readability.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java