private void notifyFlushRequest(Region region, boolean emergencyFlush) {
    FlushType type = null;
    if (emergencyFlush) {
      type = isAboveHighWaterMark();
    }
    if (type == null) {
      type = isAboveLowWaterMark();
    }
    for (FlushRequestListener listener : flushRequestListeners) {
      listener.flushRequested(type, region);
    }
  }
Flush a region.
@param region         Region to flush.
@param emergencyFlush Set if we are being force flushed. If true the region needs to be removed
                      from the flush queue. If false, when we were called from the main flusher
                      run loop and we got the entry to flush by calling poll on the flush queue
                      (which removed it).
@param families       stores of region to flush.
@return true if the region was successfully flushed, false otherwise. If false, there will be
        accompanying log messages explaining why the region was not flushed.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java