protected final void blockOnSync(SyncFuture syncFuture) throws IOException {
    // Now we have published the ringbuffer, halt the current thread until we get an answer back.
    try {
      if (syncFuture != null) {
        if (closed) {
          throw new IOException("WAL has been closed");
        } else {
          syncFuture.get(walSyncTimeoutNs);
        }
      }
    } catch (TimeoutIOException tioe) {
      throw new WALSyncTimeoutIOException(tioe);
    } catch (InterruptedException ie) {
      LOG.warn("Interrupted", ie);
      throw convertInterruptedExceptionToIOException(ie);
    } catch (ExecutionException e) {
      throw ensureIOException(e.getCause());
    }
  }
Cleans up current writer closing it and then puts in place the passed in {@code nextWriter}.
<p/>
<ul>
<li>In the case of creating a new WAL, oldPath will be null.</li>
<li>In the case of rolling over from one file to the next, none of the parameters will be null.
</li>
<li>In the case of closing out this FSHLog with no further use newPath and nextWriter will be
null.</li>
</ul>
@param oldPath    may be null
@param newPath    may be null
@param nextWriter may be null
@return the passed in <code>newPath</code>
@throws IOException if there is a problem flushing or closing the underlying FS
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java