org.opends.server.backends.jeb
Class ApproximateIndexer

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

public class ApproximateIndexer
extends Indexer

An implementation of an Indexer for attribute approximate matching.


Constructor Summary
ApproximateIndexer(AttributeType attributeType)
          Create a new attribute approximate 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(com.sleepycat.je.Transaction txn, Entry entry, java.util.Set<byte[]> keys)
          Generate the set of index keys for an entry.
 void modifyEntry(com.sleepycat.je.Transaction txn, Entry oldEntry, Entry newEntry, java.util.List<Modification> mods, java.util.Set<byte[]> addKeys, java.util.Set<byte[]> delKeys)
          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(com.sleepycat.je.Transaction txn, Entry oldEntry, Entry newEntry, java.util.Set<byte[]> addKeys, java.util.Set<byte[]> delKeys)
          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

ApproximateIndexer

public ApproximateIndexer(AttributeType attributeType)
Create a new attribute approximate indexer for the given index configuration.

Parameters:
attributeType - The attribute type for which an indexer is required.
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(com.sleepycat.je.Transaction txn,
                       Entry entry,
                       java.util.Set<byte[]> keys)
Generate the set of index keys for an entry.

Specified by:
indexEntry in class Indexer
Parameters:
txn - A database transaction to be used if the database need to be accessed in the course of generating the index keys.
entry - The entry.
keys - The set into which the generated keys will be inserted.

replaceEntry

public void replaceEntry(com.sleepycat.je.Transaction txn,
                         Entry oldEntry,
                         Entry newEntry,
                         java.util.Set<byte[]> addKeys,
                         java.util.Set<byte[]> delKeys)
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:
txn - A database transaction to be used if the database need to be accessed in the course of generating the index keys.
oldEntry - The original entry contents.
newEntry - The new entry contents.
addKeys - The set into which the keys to be added will be inserted.
delKeys - The set into which the keys to be deleted will be inserted.

modifyEntry

public void modifyEntry(com.sleepycat.je.Transaction txn,
                        Entry oldEntry,
                        Entry newEntry,
                        java.util.List<Modification> mods,
                        java.util.Set<byte[]> addKeys,
                        java.util.Set<byte[]> delKeys)
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:
txn - A database transaction to be used if the database need to be accessed in the course of generating the index keys.
oldEntry - The original entry contents.
newEntry - The new entry contents.
mods - The set of modifications that were applied to the entry.
addKeys - The set into which the keys to be added will be inserted.
delKeys - The set into which the keys to be deleted will be inserted.