org.opends.server.backends.jeb
Class SubstringIndexer

java.lang.Object
  extended by org.opends.server.backends.jeb.Indexer
      extended by org.opends.server.backends.jeb.SubstringIndexer

public class SubstringIndexer
extends Indexer

An implementation of an Indexer for attribute substrings.


Constructor Summary
SubstringIndexer(AttributeType attributeType, int substringLength)
          Create a new attribute substring indexer for the given index configuration.
 
Method Summary
 java.util.Comparator<byte[]> getComparator()
          Get the comparator that must be used to compare index keys generated by this class.
 void indexEntry(Entry entry, java.util.Set<byte[]> keys)
          Generate the set of index keys for an entry.
 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.
 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.
 java.lang.String toString()
          Get a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubstringIndexer

public SubstringIndexer(AttributeType attributeType,
                        int substringLength)
Create a new attribute substring indexer for the given index configuration.

Parameters:
attributeType - The attribute type for which an indexer is required.
substringLength - The decomposed substring length.
Method Detail

toString

public java.lang.String toString()
Get a string representation of this object. The returned value is used to name an index created using this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.

getComparator

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

Specified by:
getComparator in class Indexer
Returns:
A byte array comparator.

indexEntry

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

Specified by:
indexEntry in class Indexer
Parameters:
entry - The entry.
keys - The set into which the generated keys will be inserted.

replaceEntry

public 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.

Specified by:
replaceEntry in class Indexer
Parameters:
oldEntry - The original entry contents.
newEntry - The new entry contents.
modifiedKeys - The map into which the modified keys will be inserted.

modifyEntry

public 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.

Specified by:
modifyEntry in class Indexer
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.