protected void sanityCheckRight(byte[] right, Cell cell) throws IOException {
    if (
      !Arrays.equals(StripeStoreFileManager.OPEN_KEY, right)
        && comparator.compareRows(cell, right, 0, right.length) >= 0
    ) {
      String error = "The last row is higher or equal than the right boundary of ["
        + Bytes.toString(right) + "]: ["
        + Bytes.toString(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) + "]";
      LOG.error(error);
      throw new IOException(error);
    }
  }
Subclasses can call this method to make sure the last KV is within multi-writer range.
@param right The right boundary of the writer.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeMultiFileWriter.java