@Override
    public byte[][] split(byte[] start, byte[] end, int numSplits, boolean inclusive) {
      if (Arrays.equals(start, HConstants.EMPTY_BYTE_ARRAY)) {
        start = firstRowBytes;
      }
      if (Arrays.equals(end, HConstants.EMPTY_BYTE_ARRAY)) {
        end = lastRowBytes;
      }
      Preconditions.checkArgument(Bytes.compareTo(end, start) > 0,
        "last row (%s) is configured less than first row (%s)", Bytes.toStringBinary(end),
        Bytes.toStringBinary(start));

      byte[][] splits = Bytes.split(start, end, true, numSplits - 1);
      Preconditions.checkState(splits != null,
        "Could not calculate input splits with given user input: " + this);
      if (inclusive) {
        return splits;
      } else {
        // remove endpoints, which are included in the splits list
        return 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