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