|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.backends.jeb.AttributeIndex
public class AttributeIndex
Class representing an attribute index. We have a separate database for each type of indexing, which makes it easy to tell which attribute indexes are configured. The different types of indexing are equality, presence, substrings and ordering. The keys in the ordering index are ordered by setting the btree comparator to the ordering matching rule comparator. Note that the values in the equality index are normalized by the equality matching rule, whereas the values in the ordering index are normalized by the ordering matching rule. If these could be guaranteed to be identical then we would not need a separate ordering index.
Nested Class Summary | |
---|---|
static class |
AttributeIndex.KeyComparator
The default lexicographic byte array comparator. |
Field Summary | |
---|---|
static com.sleepycat.je.DatabaseEntry |
presenceKey
A database key for the presence index. |
Constructor Summary | |
---|---|
AttributeIndex(LocalDBIndexCfg indexConfig,
State state,
com.sleepycat.je.Environment env,
EntryContainer entryContainer)
Create a new attribute index object. |
Method Summary | |
---|---|
boolean |
addEntry(IndexBuffer buffer,
EntryID entryID,
Entry entry)
Update the attribute index for a new entry. |
boolean |
addEntry(com.sleepycat.je.Transaction txn,
EntryID entryID,
Entry entry)
Update the attribute index for a new entry. |
ConfigChangeResult |
applyConfigurationChange(LocalDBIndexCfg cfg)
Applies the configuration changes to this change listener. |
void |
close()
Close the attribute index. |
EntryIDSet |
evaluateApproximateFilter(SearchFilter approximateFilter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match an approximate filter. |
EntryIDSet |
evaluateBoundedRange(AttributeValue lowerValue,
AttributeValue upperValue)
Retrieve the entry IDs that might have a value greater than or equal to the lower bound value, and less than or equal to the upper bound value. |
EntryIDSet |
evaluateEqualityFilter(SearchFilter equalityFilter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match an equality filter. |
EntryIDSet |
evaluateGreaterOrEqualFilter(SearchFilter filter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match a greater-or-equal filter. |
EntryIDSet |
evaluateLessOrEqualFilter(SearchFilter filter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match a less-or-equal filter. |
EntryIDSet |
evaluatePresenceFilter(SearchFilter filter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match a presence filter. |
EntryIDSet |
evaluateSubstringFilter(SearchFilter filter,
java.lang.StringBuilder debugBuffer)
Retrieve the entry IDs that might match a substring filter. |
java.util.Collection<Index> |
getAllIndexes()
Retrieves all the indexes used by this attribute index. |
Index |
getApproximateIndex()
Return the approximate index. |
AttributeType |
getAttributeType()
Get the attribute type of this attribute index. |
LocalDBIndexCfg |
getConfiguration()
Get the JE index configuration used by this index. |
long |
getEntryLimitExceededCount()
Return the number of values that have exceeded the entry limit since this object was created. |
Index |
getEqualityIndex()
Return the equality index. |
java.lang.String |
getName()
Get the JE database name prefix for indexes in this attribute index. |
Index |
getOrderingIndex()
Return the ordering index. |
Index |
getPresenceIndex()
Return the presence index. |
Index |
getSubstringIndex()
Return the substring index. |
boolean |
isConfigurationChangeAcceptable(LocalDBIndexCfg cfg,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener. |
void |
listDatabases(java.util.List<DatabaseContainer> dbList)
Get a list of the databases opened by this attribute index. |
void |
modifyEntry(IndexBuffer buffer,
EntryID entryID,
Entry oldEntry,
Entry newEntry,
java.util.List<Modification> mods)
Update the index to reflect a sequence of modifications in a Modify operation. |
void |
modifyEntry(com.sleepycat.je.Transaction txn,
EntryID entryID,
Entry oldEntry,
Entry newEntry,
java.util.List<Modification> mods)
Update the index to reflect a sequence of modifications in a Modify operation. |
void |
open()
Open the attribute index. |
void |
removeEntry(IndexBuffer buffer,
EntryID entryID,
Entry entry)
Update the attribute index for a deleted entry. |
void |
removeEntry(com.sleepycat.je.Transaction txn,
EntryID entryID,
Entry entry)
Update the attribute index for a deleted entry. |
void |
setRebuildStatus(boolean rebuildRunning)
Set the rebuild status of this index. |
void |
setTrusted(com.sleepycat.je.Transaction txn,
boolean trusted)
Set the index truststate. |
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 |
Field Detail |
---|
public static final com.sleepycat.je.DatabaseEntry presenceKey
Constructor Detail |
---|
public AttributeIndex(LocalDBIndexCfg indexConfig, State state, com.sleepycat.je.Environment env, EntryContainer entryContainer) throws com.sleepycat.je.DatabaseException, ConfigException
entryContainer
- The entryContainer of this attribute index.state
- The state database to persist index state info.env
- The JE environment handle.indexConfig
- The attribute index configuration.
com.sleepycat.je.DatabaseException
- if a JE database error occurs.
ConfigException
- if a configuration related error occurs.Method Detail |
---|
public void open() throws com.sleepycat.je.DatabaseException
com.sleepycat.je.DatabaseException
- if a JE database error occurs while
openning the index.public void close() throws com.sleepycat.je.DatabaseException
com.sleepycat.je.DatabaseException
- if a JE database error occurs while
closing the index.public AttributeType getAttributeType()
public LocalDBIndexCfg getConfiguration()
public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException, JebException
buffer
- The index buffer to use to store the added keysentryID
- The entry ID.entry
- The contents of the new entry.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.
DirectoryException
- If a Directory Server error occurs.
JebException
- If an error occurs in the JE backend.public boolean addEntry(com.sleepycat.je.Transaction txn, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException, JebException
txn
- The database transaction to be used for the insertions.entryID
- The entry ID.entry
- The contents of the new entry.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.
DirectoryException
- If a Directory Server error occurs.
JebException
- If an error occurs in the JE backend.public void removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException, JebException
buffer
- The index buffer to use to store the deleted keysentryID
- The entry IDentry
- The contents of the deleted entry.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.
DirectoryException
- If a Directory Server error occurs.
JebException
- If an error occurs in the JE backend.public void removeEntry(com.sleepycat.je.Transaction txn, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException, JebException
txn
- The database transaction to be used for the deletionsentryID
- The entry IDentry
- The contents of the deleted entry.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.
DirectoryException
- If a Directory Server error occurs.
JebException
- If an error occurs in the JE backend.public void modifyEntry(com.sleepycat.je.Transaction txn, EntryID entryID, Entry oldEntry, Entry newEntry, java.util.List<Modification> mods) throws com.sleepycat.je.DatabaseException
txn
- The JE transaction to use for database updates.entryID
- The ID of the entry that was modified.oldEntry
- The entry before the modifications were applied.newEntry
- The entry after the modifications were applied.mods
- The sequence of modifications in the Modify operation.
com.sleepycat.je.DatabaseException
- If an error occurs during an operation on a
JE database.public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, Entry newEntry, java.util.List<Modification> mods) throws com.sleepycat.je.DatabaseException
buffer
- The index buffer used to buffer up the index changes.entryID
- The ID of the entry that was modified.oldEntry
- The entry before the modifications were applied.newEntry
- The entry after the modifications were applied.mods
- The sequence of modifications in the Modify operation.
com.sleepycat.je.DatabaseException
- If an error occurs during an operation on a
JE database.public EntryIDSet evaluateEqualityFilter(SearchFilter equalityFilter, java.lang.StringBuilder debugBuffer)
equalityFilter
- The equality filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public EntryIDSet evaluatePresenceFilter(SearchFilter filter, java.lang.StringBuilder debugBuffer)
filter
- The presence filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public EntryIDSet evaluateGreaterOrEqualFilter(SearchFilter filter, java.lang.StringBuilder debugBuffer)
filter
- The greater-or-equal filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public EntryIDSet evaluateLessOrEqualFilter(SearchFilter filter, java.lang.StringBuilder debugBuffer)
filter
- The less-or-equal filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public EntryIDSet evaluateSubstringFilter(SearchFilter filter, java.lang.StringBuilder debugBuffer)
filter
- The substring filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public EntryIDSet evaluateBoundedRange(AttributeValue lowerValue, AttributeValue upperValue)
lowerValue
- The lower bound valueupperValue
- The upper bound value
public EntryIDSet evaluateApproximateFilter(SearchFilter approximateFilter, java.lang.StringBuilder debugBuffer)
approximateFilter
- The approximate filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.
public long getEntryLimitExceededCount()
public void listDatabases(java.util.List<DatabaseContainer> dbList)
dbList
- A list of database containers.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isConfigurationChangeAcceptable(LocalDBIndexCfg cfg, java.util.List<Message> unacceptableReasons)
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<LocalDBIndexCfg>
cfg
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.
true
if the proposed change is
acceptable, or false
if it is not.public ConfigChangeResult applyConfigurationChange(LocalDBIndexCfg cfg)
applyConfigurationChange
in interface ConfigurationChangeListener<LocalDBIndexCfg>
cfg
- The new configuration containing the changes.
public void setTrusted(com.sleepycat.je.Transaction txn, boolean trusted) throws com.sleepycat.je.DatabaseException
txn
- A database transaction, or null if none is required.trusted
- True if this index should be trusted or false
otherwise.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.public void setRebuildStatus(boolean rebuildRunning)
rebuildRunning
- True if a rebuild process on this index
is running or False otherwise.public java.lang.String getName()
public Index getEqualityIndex()
public Index getApproximateIndex()
public Index getOrderingIndex()
public Index getSubstringIndex()
public Index getPresenceIndex()
public java.util.Collection<Index> getAllIndexes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |