public class AttributeIndex extends Object implements ConfigurationChangeListener<LocalDBIndexCfg>, Closeable
Modifier and Type | Class and Description |
---|---|
static class |
AttributeIndex.KeyComparator
Delegator to
ByteSequence.BYTE_ARRAY_COMPARATOR . |
Constructor and Description |
---|
AttributeIndex(LocalDBIndexCfg indexConfig,
EntryContainer entryContainer)
Create a new attribute index object.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(IndexBuffer buffer,
EntryID entryID,
Entry entry)
Update the attribute index for a new entry.
|
ConfigChangeResult |
applyConfigurationChange(LocalDBIndexCfg newConfiguration)
Applies the configuration changes to this change listener.
|
void |
close()
Closes the attribute index.
|
EntryIDSet |
evaluateBoundedRange(SearchFilter filter1,
SearchFilter filter2,
StringBuilder debugBuffer,
org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
Retrieve the entry IDs that might match two filters that restrict a value
to both a lower bound and an upper bound.
|
EntryIDSet |
evaluateExtensibleFilter(SearchFilter filter,
StringBuilder debugBuffer,
org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
Retrieve the entry IDs that might match an extensible filter.
|
EntryIDSet |
evaluateFilter(org.opends.server.backends.jeb.AttributeIndex.IndexFilterType indexFilterType,
SearchFilter filter,
StringBuilder debugBuffer,
org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
Retrieve the entry IDs that might match a filter.
|
Collection<Index> |
getAllIndexes()
Retrieves all the indexes used by this attribute 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.
|
org.forgerock.opendj.ldap.spi.IndexingOptions |
getIndexingOptions()
Return the indexing options of this AttributeIndex.
|
String |
getName()
Get the JE database name prefix for indexes in this attribute index.
|
boolean |
isConfigurationChangeAcceptable(LocalDBIndexCfg cfg,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is
acceptable to this change listener.
|
boolean |
isTrusted()
Return true iff this index is trusted.
|
void |
listDatabases(List<DatabaseContainer> dbList)
Get a list of the databases opened by this attribute index.
|
void |
modifyEntry(IndexBuffer buffer,
EntryID entryID,
Entry oldEntry,
Entry newEntry,
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.
|
String |
toString()
Get a string representation of this object.
|
public AttributeIndex(LocalDBIndexCfg indexConfig, EntryContainer entryContainer) throws ConfigException
indexConfig
- The attribute index configuration.entryContainer
- The entryContainer of this attribute index.ConfigException
- if a configuration related error occurs.public void open() throws com.sleepycat.je.DatabaseException
com.sleepycat.je.DatabaseException
- if a JE database error occurs while
opening the index.public void close()
close
in interface Closeable
close
in interface AutoCloseable
public AttributeType getAttributeType()
public org.forgerock.opendj.ldap.spi.IndexingOptions getIndexingOptions()
public LocalDBIndexCfg getConfiguration()
public void addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException
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.public void removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException
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.public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, Entry newEntry, 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 evaluateBoundedRange(SearchFilter filter1, SearchFilter filter2, StringBuilder debugBuffer, org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
filter1
- The first filter, that is either a less-or-equal filter or a
greater-or-equal filter.filter2
- The second filter, that is either a less-or-equal filter or a
greater-or-equal filter. It must not be of the same type than the
first filter.debugBuffer
- If not null, a diagnostic string will be written which will help
determine how the indexes contributed to this search.monitor
- The database environment monitor provider that will keep index
filter usage statistics.public EntryIDSet evaluateFilter(org.opends.server.backends.jeb.AttributeIndex.IndexFilterType indexFilterType, SearchFilter filter, StringBuilder debugBuffer, org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
indexFilterType
- the index type filterfilter
- The filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.monitor
- The database environment monitor provider that will keep
index filter usage statistics.public long getEntryLimitExceededCount()
public void listDatabases(List<DatabaseContainer> dbList)
dbList
- A list of database containers.public boolean isConfigurationChangeAcceptable(LocalDBIndexCfg cfg, List<LocalizableMessage> 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 newConfiguration)
applyConfigurationChange
in interface ConfigurationChangeListener<LocalDBIndexCfg>
newConfiguration
- The new configuration containing the changes.public boolean isTrusted()
public String getName()
public Collection<Index> getAllIndexes()
public EntryIDSet evaluateExtensibleFilter(SearchFilter filter, StringBuilder debugBuffer, org.opends.server.backends.jeb.DatabaseEnvironmentMonitor monitor)
filter
- The extensible filter.debugBuffer
- If not null, a diagnostic string will be written
which will help determine how the indexes contributed
to this search.monitor
- The database environment monitor provider that will keep
index filter usage statistics.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.