public FlushResult flush(boolean flushAllStores) throws IOException {
    return flushcache(flushAllStores, false, FlushLifeCycleTracker.DUMMY);
  }
Flush the cache.
<p>
When this method is called the cache will be flushed unless:
<ol>
<li>the cache is empty</li>
<li>the region is closed.</li>
<li>a flush is already in progress</li>
<li>writes are disabled</li>
</ol>
<p>
This method may block for some time, so it should not be called from a time-sensitive thread.
@param flushAllStores whether we want to force a flush of all stores
@return FlushResult indicating whether the flush was successful or not and if the region needs
        compacting
@throws IOException general io exceptions because a snapshot was not properly persisted.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java