org.opends.server.backends.jeb
Class Indexer

java.lang.Object
  extended by org.opends.server.backends.jeb.Indexer
Direct Known Subclasses:
ApproximateIndexer, EqualityIndexer, ID2CIndexer, ID2SIndexer, OrderingIndexer, PresenceIndexer, SubstringIndexer

public abstract class Indexer
extends java.lang.Object

This class attempts to abstract the generation and comparison of keys for an index. It is subclassed for the specific type of indexing.


Constructor Summary
Indexer()
           
 
Method Summary
abstract  java.util.Comparator<byte[]> getComparator()
          Get the comparator that must be used to compare index keys generated by this class.
abstract  void indexEntry(Entry entry, java.util.Set<byte[]> keys)
          Generate the set of index keys for an entry.
abstract  void modifyEntry(Entry oldEntry, Entry newEntry, java.util.List<Modification> mods, java.util.Map<byte[],java.lang.Boolean> modifiedKeys)
          Generate the set of index keys to be added and the set of index keys to be deleted for an entry that was modified.
abstract  void replaceEntry(Entry oldEntry, Entry newEntry, java.util.Map<byte[],java.lang.Boolean> modifiedKeys)
          Generate the set of index keys to be added and the set of index keys to be deleted for an entry that has been replaced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Indexer

public Indexer()
Method Detail

getComparator

public abstract java.util.Comparator<byte[]> getComparator()
Get the comparator that must be used to compare index keys generated by this class.

Returns:
A byte array comparator.

indexEntry

public abstract void indexEntry(Entry entry,
                                java.util.Set<byte[]> keys)
                         throws com.sleepycat.je.DatabaseException
Generate the set of index keys for an entry.

Parameters:
entry - The entry.
keys - The set into which the generated keys will be inserted.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

replaceEntry

public abstract void replaceEntry(Entry oldEntry,
                                  Entry newEntry,
                                  java.util.Map<byte[],java.lang.Boolean> modifiedKeys)
                           throws com.sleepycat.je.DatabaseException
Generate the set of index keys to be added and the set of index keys to be deleted for an entry that has been replaced.

Parameters:
oldEntry - The original entry contents.
newEntry - The new entry contents.
modifiedKeys - The map into which the modified keys will be inserted.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

modifyEntry

public abstract void modifyEntry(Entry oldEntry,
                                 Entry newEntry,
                                 java.util.List<Modification> mods,
                                 java.util.Map<byte[],java.lang.Boolean> modifiedKeys)
                          throws com.sleepycat.je.DatabaseException
Generate the set of index keys to be added and the set of index keys to be deleted for an entry that was modified.

Parameters:
oldEntry - The original entry contents.
newEntry - The new entry contents.
mods - The set of modifications that were applied to the entry.
modifiedKeys - The map into which the modified keys will be inserted.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.