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

Ludovic Poitou
25.03.2015 6c53ea444321018f60429fc0bb5598dd91445386
OPENDJ-2422: Allow to have a configurable limit for Scope cursoring. The limit is now set to the min between the backend index entry limit and the lookthrough limit. If the backend has unlimited index entry limit (value of 0), we use the cursoring limit for indexes (100 000).
1 files modified
6 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
@@ -127,8 +127,6 @@
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** Number of EntryID to considers when building EntryIDSet from DN2ID. */
  private static final int SCOPE_IDSET_LIMIT = 4096;
  /** The name of the entry tree. */
  private static final String ID2ENTRY_TREE_NAME = ID2ENTRY_INDEX_NAME;
  /** The name of the DN tree. */
@@ -827,8 +825,10 @@
            if (!isBelowFilterThreshold(entryIDSet))
            {
              final int lookThroughLimit = searchOperation.getClientConnection().getLookthroughLimit();
              final int indexLimit =
                  config.getIndexEntryLimit() == 0 ? CURSOR_ENTRY_LIMIT : config.getIndexEntryLimit();
              final int idSetLimit =
                  lookThroughLimit == 0 ? SCOPE_IDSET_LIMIT : Math.min(SCOPE_IDSET_LIMIT, lookThroughLimit);
                  lookThroughLimit == 0 ? indexLimit : Math.min(indexLimit, lookThroughLimit);
              final EntryIDSet scopeSet = getIDSetFromScope(txn, aBaseDN, searchScope, idSetLimit);
              entryIDSet.retainAll(scopeSet);