private long maxKeyWeCanRead() {
      long insertedUpToKey = writer.wroteUpToKey();
      if (insertedUpToKey >= endKey - 1) {
        // The writer has finished writing our range, so we can read any
        // key in the range.
        return endKey - 1;
      }
      return Math.min(endKey - 1, writer.wroteUpToKey() - keyWindow);
    }
Should only be used for the concurrent writer/reader workload. The maximum key we are allowed
to read, subject to the "key window" constraint.
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/MultiThreadedReader.java