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