示例#1
0
文件: Log.java 项目: AbacusHu/OpenDJ
 /**
  * Disable the cursors opened on the head log file log, by closing their underlying cursor.
  * Returns the state of each cursor just before the close operation.
  *
  * @return the pairs (cursor, cursor state) for each cursor pointing to head log file.
  * @throws ChangelogException If an error occurs.
  */
 private List<Pair<AbortableLogCursor<K, V>, CursorState<K, V>>> disableOpenedCursorsOnHead()
     throws ChangelogException {
   final List<Pair<AbortableLogCursor<K, V>, CursorState<K, V>>> openCursorsStates =
       new ArrayList<>();
   final LogFile<K, V> headLogFile = getHeadLogFile();
   for (AbortableLogCursor<K, V> cursor : openCursors) {
     if (cursor.isAccessingLogFile(headLogFile)) {
       openCursorsStates.add(Pair.of(cursor, cursor.getState()));
       cursor.closeUnderlyingCursor();
     }
   }
   return openCursorsStates;
 }