Exemplo n.º 1
0
 @Override
 public boolean next() throws ChangelogException {
   final boolean hasNext = currentCursor.next();
   if (hasNext) {
     return true;
   }
   final LogFile<K, V> logFile = log.getNextLogFile(currentLogFile);
   if (logFile != null) {
     switchToLogFile(logFile);
     return currentCursor.next();
   }
   return false;
 }
Exemplo n.º 2
0
 @Override
 public boolean positionTo(
     final K key,
     final KeyMatchingStrategy matchStrategy,
     final PositionStrategy positionStrategy)
     throws ChangelogException {
   final LogFile<K, V> logFile = log.findLogFileFor(key);
   if (logFile != currentLogFile) {
     switchToLogFile(logFile);
   }
   return (key == null) ? true : currentCursor.positionTo(key, matchStrategy, positionStrategy);
 }
Exemplo n.º 3
0
 /** Returns the state of this cursor. */
 @Override
 CursorState<K, V> getState() throws ChangelogException {
   return new CursorState<>(
       currentLogFile, currentCursor.getFilePosition(), currentCursor.getRecord());
 }
Exemplo n.º 4
0
 @Override
 public Record<K, V> getRecord() {
   return currentCursor != null ? currentCursor.getRecord() : null;
 }