Beispiel #1
0
 @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();
   }
 }
Beispiel #2
0
 @Override
 public Record<K, V> getRecord() {
   log.sharedLock.lock();
   try {
     return delegate.getRecord();
   } finally {
     log.sharedLock.unlock();
   }
 }
Beispiel #3
0
 @Override
 public void close() {
   log.sharedLock.lock();
   try {
     delegate.close();
     log.unregisterCursor(this);
   } finally {
     log.sharedLock.unlock();
   }
 }
Beispiel #4
0
 @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();
   }
 }
Beispiel #5
0
 @Override
 public String toString() {
   return delegate.toString();
 }
Beispiel #6
0
 /**
  * {@inheritDoc}
  *
  * <p>This method is called only when log.exclusiveLock has been acquired.
  */
 @Override
 boolean isAccessingLogFile(LogFile<K, V> logFile) {
   return delegate.isAccessingLogFile(logFile);
 }
Beispiel #7
0
 /**
  * {@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);
 }
Beispiel #8
0
 /**
  * {@inheritDoc}
  *
  * <p>This method is called only when log.exclusiveLock has been acquired.
  */
 @Override
 void closeUnderlyingCursor() {
   delegate.closeUnderlyingCursor();
 }
Beispiel #9
0
 /**
  * {@inheritDoc}
  *
  * <p>This method is called only when log.exclusiveLock has been acquired.
  */
 @Override
 CursorState<K, V> getState() throws ChangelogException {
   return delegate.getState();
 }