@Override
  public void flush() throws StorageException {
    ConcurrencyUtil.withLock(myLock.readLock(), () -> {
      try {
        doFlush();
      }
      catch (IOException e) {
        throw new StorageException(e);
      }
      catch (RuntimeException e) {
        final Throwable cause = e.getCause();
        if (cause instanceof StorageException || cause instanceof IOException) {
          throw new StorageException(cause);
        }
        else {
          throw e;
        }
      }
    });
  }
@Override
  public void flush()