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

Jean-Noel Rouvignac
12.19.2015 ae6b4362fce94c2d5c81f64d612a604971239d31
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/Index.java
@@ -33,7 +33,6 @@
import java.util.*;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.ldap.ByteSequence;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ConditionResult;
import org.forgerock.opendj.ldap.spi.IndexingOptions;
@@ -56,12 +55,7 @@
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** The indexer object to construct index keys from LDAP attribute values. */
  public Indexer indexer;
  /** The comparator for index keys. */
  private final Comparator<byte[]> comparator;
  /** The comparator for index keys. */
  private final Comparator<ByteSequence> bsComparator;
  private Indexer indexer;
  /** The limit on the number of entry IDs that may be indexed by one key. */
  private int indexEntryLimit;
@@ -133,8 +127,6 @@
  {
    super(name, env, entryContainer);
    this.indexer = indexer;
    this.comparator = indexer.getComparator();
    this.bsComparator = indexer.getBSComparator();
    this.indexEntryLimit = indexEntryLimit;
    this.cursorEntryLimit = cursorEntryLimit;
    this.maintainCount = maintainCount;
@@ -144,7 +136,7 @@
    this.dbConfig = JEBUtils.toDatabaseConfigNoDuplicates(env);
    this.dbConfig.setOverrideBtreeComparator(true);
    this.dbConfig.setBtreeComparator((Class<? extends Comparator<byte[]>>)
                                     comparator.getClass());
                                     indexer.getComparator().getClass());
    this.state = state;
@@ -157,6 +149,11 @@
    }
  }
  void indexEntry(Entry entry, Set<ByteString> keys, IndexingOptions options)
  {
    indexer.indexEntry(entry, keys, options);
  }
  /**
   * Add an add entry ID operation into a index buffer.
   *
@@ -460,7 +457,7 @@
  private BufferedIndexValues getBufferedIndexValues(IndexBuffer buffer, ByteString keyBytes)
  {
    return buffer.getBufferedIndexValues(this, keyBytes, bsComparator);
    return buffer.getBufferedIndexValues(this, keyBytes, indexer.getBSComparator());
  }
  /**
@@ -619,6 +616,7 @@
      Cursor cursor = openCursor(null, CursorConfig.READ_COMMITTED);
      try
      {
        final Comparator<byte[]> comparator = indexer.getComparator();
        OperationStatus status;
        // Set the lower bound if necessary.
        if(lower.length > 0)
@@ -874,6 +872,6 @@
   */
  public Comparator<byte[]> getComparator()
  {
    return this.comparator;
    return indexer.getComparator();
  }
}