private void checkReadOnly() throws IOException {
    if (isReadOnly()) {
      throw new DoNotRetryIOException("region is read only");
    }
  }
@throws IOException Throws exception if region is in read-only mode.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java