Roll the log writer. That is, start writing log messages to a new file. Because a log cannot be rolled during a cache flush, and a cache flush spans two method calls, a special lock needs to be obtained so that a cache flush cannot start when the log is being rolled and the log cannot be rolled during a cache flush.
Note that this method cannot be synchronized because it is possible that startCacheFlush runs, obtaining the cacheFlushLock, then this method could start which would obtain the lock on this but block on obtaining the cacheFlushLock and then completeCacheFlush could be called which would wait for the lock on this and consequently never release the cacheFlushLock
@return If lots of logs, flush the returned regions so next time throughwe can clean logs. Returns null if nothing to flush. Names are actual region names as returned by {@link HRegionInfo#getEncodedName()}
@throws org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException
@throws IOException