@Override public boolean next() throws ChangelogException { log.sharedLock.lock(); try { if (mustAbort) { delegate.close(); delegate = new AbortedLogCursor<>(log.getPath()); mustAbort = false; } return delegate.next(); } finally { log.sharedLock.unlock(); } }
@Override public Record<K, V> getRecord() { log.sharedLock.lock(); try { return delegate.getRecord(); } finally { log.sharedLock.unlock(); } }
@Override public void close() { log.sharedLock.lock(); try { delegate.close(); log.unregisterCursor(this); } finally { log.sharedLock.unlock(); } }
@Override public boolean positionTo( K key, KeyMatchingStrategy matchStrategy, PositionStrategy positionStrategy) throws ChangelogException { log.sharedLock.lock(); try { return delegate.positionTo(key, matchStrategy, positionStrategy); } finally { log.sharedLock.unlock(); } }
@Override public String toString() { return delegate.toString(); }
/** * {@inheritDoc} * * <p>This method is called only when log.exclusiveLock has been acquired. */ @Override boolean isAccessingLogFile(LogFile<K, V> logFile) { return delegate.isAccessingLogFile(logFile); }
/** * {@inheritDoc} * * <p>This method is called only when log.exclusiveLock has been acquired. */ @Override void reinitializeTo(final CursorState<K, V> cursorState) throws ChangelogException { delegate.reinitializeTo(cursorState); }
/** * {@inheritDoc} * * <p>This method is called only when log.exclusiveLock has been acquired. */ @Override void closeUnderlyingCursor() { delegate.closeUnderlyingCursor(); }
/** * {@inheritDoc} * * <p>This method is called only when log.exclusiveLock has been acquired. */ @Override CursorState<K, V> getState() throws ChangelogException { return delegate.getState(); }