mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
08.48.2015 a89f7014aeb71dba5c94404dfea7eb89e7eeee74
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
@@ -124,7 +124,7 @@
  };
  /** Map that holds the unique log instance for each log path. */
  private static final Map<File, Log<?, ?>> logsCache = new HashMap<File, Log<?, ?>>();
  private static final Map<File, Log<?, ?>> logsCache = new HashMap<>();
  /**
   * The number of references on this log instance. It is incremented each time
@@ -153,7 +153,7 @@
   * <p>
   * The read-only log files are associated with the highest key they contain.
   */
  private final TreeMap<K, LogFile<K, V>> logFiles = new TreeMap<K, LogFile<K, V>>();
  private final TreeMap<K, LogFile<K, V>> logFiles = new TreeMap<>();
  /**
   * The last key appended to the log. In order to keep the ordering of the keys
@@ -166,7 +166,7 @@
   * The list of non-empty cursors opened on this log. Opened cursors may have
   * to be updated when rotating the head log file.
   */
  private final List<AbortableLogCursor<K, V>> openCursors = new CopyOnWriteArrayList<AbortableLogCursor<K, V>>();
  private final List<AbortableLogCursor<K, V>> openCursors = new CopyOnWriteArrayList<>();
  /**
   * A log file can be rotated once it has exceeded this size limit. The log file can have
@@ -234,7 +234,7 @@
    Log<K, V> log = (Log<K, V>) logsCache.get(logPath);
    if (log == null)
    {
      log = new Log<K, V>(replicationEnv, logPath, parser, rotationParameters);
      log = new Log<>(replicationEnv, logPath, parser, rotationParameters);
      logsCache.put(logPath, log);
    }
    else
@@ -254,7 +254,7 @@
   * @return an empty cursor
   */
  static <K extends Comparable<K>, V> RepositionableCursor<K, V> getEmptyCursor() {
    return new Log.EmptyCursor<K, V>();
    return new Log.EmptyCursor<>();
  }
  /** Holds the parameters for log files rotation. */
@@ -537,9 +537,9 @@
    {
      if (isClosed)
      {
        return new EmptyCursor<K, V>();
        return new EmptyCursor<>();
      }
      cursor = new AbortableLogCursor<K, V>(this, new InternalLogCursor<K, V>(this));
      cursor = new AbortableLogCursor<>(this, new InternalLogCursor<K, V>(this));
      cursor.positionTo(null, null, null);
      registerCursor(cursor);
      return cursor;
@@ -600,9 +600,9 @@
    {
      if (isClosed)
      {
        return new EmptyCursor<K, V>();
        return new EmptyCursor<>();
      }
      cursor = new AbortableLogCursor<K, V>(this, new InternalLogCursor<K, V>(this));
      cursor = new AbortableLogCursor<>(this, new InternalLogCursor<K, V>(this));
      final boolean isSuccessfullyPositioned = cursor.positionTo(key, matchingStrategy, positionStrategy);
      // Allow for cursor re-initialization after exhaustion in case of
      // LESS_THAN_OR_EQUAL_TO_KEY ands GREATER_THAN_OR_EQUAL_TO_KEY strategies
@@ -614,7 +614,7 @@
      else
      {
        StaticUtils.close(cursor);
        return new EmptyCursor<K, V>();
        return new EmptyCursor<>();
      }
    }
    catch (ChangelogException e)
@@ -719,7 +719,7 @@
      {
        return null;
      }
      final List<String> undeletableFiles = new ArrayList<String>();
      final List<String> undeletableFiles = new ArrayList<>();
      final Iterator<LogFile<K, V>> entriesToPurge = logFilesToPurge.values().iterator();
      while (entriesToPurge.hasNext())
      {
@@ -793,7 +793,7 @@
      }
      // delete all log files
      final List<String> undeletableFiles = new ArrayList<String>();
      final List<String> undeletableFiles = new ArrayList<>();
      for (LogFile<K, V> logFile : logFiles.values())
      {
        try
@@ -1256,7 +1256,7 @@
    @Override
    CursorState<K, V> getState() throws ChangelogException
    {
      return new CursorState<K, V>(currentLogFile, currentCursor.getFilePosition(), currentCursor.getRecord());
      return new CursorState<>(currentLogFile, currentCursor.getFilePosition(), currentCursor.getRecord());
    }
    @Override
@@ -1462,7 +1462,7 @@
        if (mustAbort)
        {
          delegate.close();
          delegate = new AbortedLogCursor<K, V>(log.getPath());
          delegate = new AbortedLogCursor<>(log.getPath());
          mustAbort = false;
        }
        return delegate.next();