|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.backends.jeb.DatabaseContainer
org.opends.server.backends.jeb.Index
public class Index
Represents an index implemented by a JE database in which each key maps to a set of entry IDs. The key is a byte array, and is constructed from some normalized form of an attribute value (or fragment of a value) appearing in the entry.
Field Summary | |
---|---|
Indexer |
indexer
The indexer object to construct index keys from LDAP attribute values. |
Fields inherited from class org.opends.server.backends.jeb.DatabaseContainer |
---|
dbConfig, entryContainer, name |
Constructor Summary | |
---|---|
Index(java.lang.String name,
Indexer indexer,
State state,
int indexEntryLimit,
int cursorEntryLimit,
boolean maintainCount,
com.sleepycat.je.Environment env,
EntryContainer entryContainer)
Create a new index object. |
Method Summary | |
---|---|
boolean |
addEntry(IndexBuffer buffer,
EntryID entryID,
Entry entry)
Update the index buffer for a deleted entry. |
boolean |
addEntry(com.sleepycat.je.Transaction txn,
EntryID entryID,
Entry entry)
Update the index for a new entry. |
ConditionResult |
containsID(com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
EntryID entryID)
Check if an entry ID is in the set of IDs indexed by a given key. |
void |
delete(IndexBuffer buffer,
byte[] keyBytes)
Buffered delete of a key from the JE database. |
void |
delete(com.sleepycat.je.Transaction txn,
java.util.Set<byte[]> keySet,
EntryID entryID)
Delete specified entry ID from all keys in the provided key set. |
int |
getEntryLimitExceededCount()
Get the number of keys that have exceeded the entry limit since this object was created. |
int |
getIndexEntryLimit()
Return entry limit. |
boolean |
getMaintainCount()
Whether this index maintains a count of IDs for keys once the entry limit has exceeded. |
void |
incEntryLimitExceededCount()
Increment the count of the number of keys that have exceeded the entry limit since this object was created. |
void |
insert(com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
ImportIDSet importIdSet,
com.sleepycat.je.DatabaseEntry data)
Add the specified import ID set to the provided key. |
boolean |
insert(com.sleepycat.je.Transaction txn,
ImportIDSet importIDSet,
java.util.Set<byte[]> keySet,
com.sleepycat.je.DatabaseEntry keyData,
com.sleepycat.je.DatabaseEntry data)
Add the specified import ID set to the provided keys in the keyset. |
boolean |
insertID(IndexBuffer buffer,
byte[] keyBytes,
EntryID entryID)
Add an add entry ID operation into a index buffer. |
boolean |
insertID(com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
EntryID entryID)
Insert an entry ID into the set of IDs indexed by a given key. |
boolean |
isTrusted()
Return true iff this index is trusted. |
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. |
EntryIDSet |
readKey(com.sleepycat.je.DatabaseEntry key,
com.sleepycat.je.Transaction txn,
com.sleepycat.je.LockMode lockMode)
Reads the set of entry IDs for a given key. |
EntryIDSet |
readRange(byte[] lower,
byte[] upper,
boolean lowerIncluded,
boolean upperIncluded)
Reads a range of keys and collects all their entry IDs into a single set. |
void |
removeEntry(IndexBuffer buffer,
EntryID entryID,
Entry entry)
Update the index buffer for a deleted entry. |
void |
removeEntry(com.sleepycat.je.Transaction txn,
EntryID entryID,
Entry entry)
Update the index for a deleted entry. |
boolean |
removeID(IndexBuffer buffer,
byte[] keyBytes,
EntryID entryID)
Add an remove entry ID operation into a index buffer. |
void |
removeID(com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
EntryID entryID)
Remove an entry ID from the set of IDs indexed by a given key. |
boolean |
setIndexEntryLimit(int indexEntryLimit)
Set the index entry limit. |
void |
setIndexer(Indexer indexer)
Set the indexer. |
void |
setRebuildStatus(boolean rebuildRunning)
Set the rebuild status of this index. |
void |
setTrusted(com.sleepycat.je.Transaction txn,
boolean trusted)
Set the index trust state. |
void |
writeKey(com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
EntryIDSet entryIDList)
Writes the set of entry IDs for a given key. |
Methods inherited from class org.opends.server.backends.jeb.DatabaseContainer |
---|
delete, getName, getRecordCount, insert, open, openCursor, preload, put, read, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Indexer indexer
Constructor Detail |
---|
public Index(java.lang.String name, Indexer indexer, State state, int indexEntryLimit, int cursorEntryLimit, boolean maintainCount, com.sleepycat.je.Environment env, EntryContainer entryContainer) throws com.sleepycat.je.DatabaseException
name
- The name of the index database within the entryContainer.indexer
- The indexer object to construct index keys from LDAP
attribute values.state
- The state database to persist index state info.indexEntryLimit
- The configured limit on the number of entry IDs
that may be indexed by one key.cursorEntryLimit
- The configured limit on the number of entry IDsmaintainCount
- Whether to maintain a count of IDs for a key once
the entry limit has exceeded.env
- The JE EnvironemntentryContainer
- The database entryContainer holding this index.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.Method Detail |
---|
public boolean insertID(IndexBuffer buffer, byte[] keyBytes, EntryID entryID)
buffer
- The index buffer to insert the ID into.keyBytes
- The index key bytes.entryID
- The entry ID.
public boolean insertID(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, EntryID entryID) throws com.sleepycat.je.DatabaseException
txn
- A database transaction, or null if none is required.key
- The index key.entryID
- The entry ID.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.public void insert(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, ImportIDSet importIdSet, com.sleepycat.je.DatabaseEntry data) throws com.sleepycat.je.DatabaseException
txn
- A transaction.key
- The key to add the set to.importIdSet
- The set of import IDs.data
- Database entry to reuse for read
com.sleepycat.je.DatabaseException
- If an database error occurs.public boolean insert(com.sleepycat.je.Transaction txn, ImportIDSet importIDSet, java.util.Set<byte[]> keySet, com.sleepycat.je.DatabaseEntry keyData, com.sleepycat.je.DatabaseEntry data) throws com.sleepycat.je.DatabaseException
txn
- A transaction.importIDSet
- A import ID set to use.keySet
- The set containing the keys.keyData
- A key database entry to use.data
- A database entry to use for data.
True
if the insert was successful.
com.sleepycat.je.DatabaseException
- If a database error occurs.public boolean removeID(IndexBuffer buffer, byte[] keyBytes, EntryID entryID)
buffer
- The index buffer to insert the ID into.keyBytes
- The index key bytes.entryID
- The entry ID.
public void removeID(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, EntryID entryID) throws com.sleepycat.je.DatabaseException
txn
- A database transaction, or null if none is required.key
- The index key.entryID
- The entry ID.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.public void delete(com.sleepycat.je.Transaction txn, java.util.Set<byte[]> keySet, EntryID entryID) throws com.sleepycat.je.DatabaseException
txn
- A Transaction.keySet
- A set of keys.entryID
- The entry ID to delete.
com.sleepycat.je.DatabaseException
- If a database error occurs.public void delete(IndexBuffer buffer, byte[] keyBytes)
buffer
- The index buffer to use to store the deleted keyskeyBytes
- The index key bytes.public ConditionResult containsID(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, EntryID entryID) throws com.sleepycat.je.DatabaseException
txn
- A database transaction, or null if none is required.key
- The index key.entryID
- The entry ID.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.public EntryIDSet readKey(com.sleepycat.je.DatabaseEntry key, com.sleepycat.je.Transaction txn, com.sleepycat.je.LockMode lockMode)
key
- The database key.txn
- A database transaction, or null if none is required.lockMode
- The JE locking mode to be used for the database read.
public void writeKey(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, EntryIDSet entryIDList) throws com.sleepycat.je.DatabaseException
key
- The database key.entryIDList
- The entry IDs indexed by this key.txn
- A database transaction, or null if none is required.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.public EntryIDSet readRange(byte[] lower, byte[] upper, boolean lowerIncluded, boolean upperIncluded)
lower
- The lower bound of the range. A 0 length byte array indicates
no lower bound and the range will start from the
smallest key.upper
- The upper bound of the range. A 0 length byte array indicates
no upper bound and the range will end at the largest
key.lowerIncluded
- true if a key exactly matching the lower bound
is included in the range, false if only keys
strictly greater than the lower bound are included.
This value is ignored if the lower bound is not
specified.upperIncluded
- true if a key exactly matching the upper bound
is included in the range, false if only keys
strictly less than the upper bound are included.
This value is ignored if the upper bound is not
specified.
public int getEntryLimitExceededCount()
public void incEntryLimitExceededCount()
public boolean addEntry(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 ID.entry
- The entry to be indexed.
com.sleepycat.je.DatabaseException
- If an error occurs in the JE database.
DirectoryException
- If a Directory Server error occurs.public boolean addEntry(com.sleepycat.je.Transaction txn, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException
txn
- A database transaction, or null if none is required.entryID
- The entry ID.entry
- The entry to be indexed.
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 removeEntry(com.sleepycat.je.Transaction txn, EntryID entryID, Entry entry) throws com.sleepycat.je.DatabaseException, DirectoryException
txn
- A database transaction, or null if none is required.entryID
- 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(com.sleepycat.je.Transaction txn, EntryID entryID, Entry oldEntry, Entry newEntry, java.util.List<Modification> mods) throws com.sleepycat.je.DatabaseException
txn
- A database transaction, or null if none is required.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 in the 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 to use to store the deleted keysentryID
- 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 in the JE database.public boolean setIndexEntryLimit(int indexEntryLimit)
indexEntryLimit
- The index entry limit to set.
public void setIndexer(Indexer indexer)
indexer
- The indexer to setpublic int getIndexEntryLimit()
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 boolean isTrusted()
public void setRebuildStatus(boolean rebuildRunning)
rebuildRunning
- True if a rebuild process on this index
is running or False otherwise.public boolean getMaintainCount()
true
if this index maintains court of IDs
or false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |