K - The Indexed value type, used to retrieve an elementE - The unique identifier type in the master tablepublic interface Index<K,E>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_INDEX_CACHE_SIZE
The default cache size (ie, the number of elements we stored in the cache)
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal,
E entryId)
Add an entry into the index, associated with the element E.
|
void |
close(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn)
Close and index
|
long |
count(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn)
Gets the total scan count for this index.
|
long |
count(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal)
Gets the scan count for the occurrence of a specific attribute value
within the index.
|
void |
drop(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
E entryId)
Remove all the reference to an entry from the index.
|
void |
drop(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal,
E entryId)
Remove the pair <K,ID> from the index for the given value and id.
|
boolean |
forward(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal)
Try to move forward in the index
|
boolean |
forward(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal,
E entryId)
Try to move forward in the index
|
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,E>> |
forwardCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn)
Builds a Cursor on the Forward index
|
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,E>> |
forwardCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K key)
Builds a Cursor on the Forward index, starting at a specific key
|
E |
forwardLookup(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal)
Search for a value using the Forward table
|
org.apache.directory.api.ldap.model.cursor.Cursor<E> |
forwardValueCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K key)
Builds a Cursor on the Forward index, starting at a specific key
|
org.apache.directory.api.ldap.model.schema.AttributeType |
getAttribute()
Gets the attribute this Index is built upon.
|
String |
getAttributeId()
Gets the attribute identifier set at configuration time for this index which may not
be the OID but an alias name for the attributeType associated with this Index
|
int |
getCacheSize()
Gets the size of the index cache in terms of the number of index entries to be cached.
|
URI |
getWkDirPath()
Gets the working directory path to something other than the default.
|
long |
greaterThanCount(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal)
Find the number of element in a tree above a given key
|
boolean |
hasReverse()
Tells if the index has a reverse table or not
|
boolean |
isDupsEnabled()
tells whether the Index implementation supports storing duplicate keys
|
long |
lessThanCount(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
K attrVal)
Find the number of element in a tree below a given key
|
boolean |
reverse(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
E entryId)
Try to move backward in the index
|
boolean |
reverse(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
E entryId,
K attrVal)
Try to move backward in the index
|
K |
reverseLookup(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
E element)
Search for a value using the Reverse table
|
org.apache.directory.api.ldap.model.cursor.Cursor<K> |
reverseValueCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn,
E entryId)
Builds a Cursor on the Reverse index, starting at a specific entry Id
|
void |
setAttributeId(String attributeId)
Sets the attribute identifier set at configuration time for this index which may not
be the OID but an alias name for the attributeType associated with this Index
|
void |
setCacheSize(int cacheSize)
Sets the size of the index cache in terms of the number of index entries to be cached.
|
void |
setWkDirPath(URI wkDirPath)
Sets the working directory path to something other than the default.
|
static final int DEFAULT_INDEX_CACHE_SIZE
String getAttributeId()
void setAttributeId(String attributeId)
attributeId - configured attribute oid or alias nameint getCacheSize()
void setCacheSize(int cacheSize)
cacheSize - the size of the index cachevoid setWkDirPath(URI wkDirPath)
wkDirPath - optional working directory pathURI getWkDirPath()
org.apache.directory.api.ldap.model.schema.AttributeType getAttribute()
long count(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException - on failure to access index db fileslong count(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - the value of the attribute to get a scan count fororg.apache.directory.api.ldap.model.exception.LdapException - on failure to access index db fileslong greaterThanCount(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The keyorg.apache.directory.api.ldap.model.exception.LdapException - If the operation failedlong lessThanCount(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The keyorg.apache.directory.api.ldap.model.exception.LdapException - If the operation failedE forwardLookup(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The key to retrieveorg.apache.directory.api.ldap.model.exception.LdapException - If the operation failedK reverseLookup(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, E element) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useelement - The key to retrieveorg.apache.directory.api.ldap.model.exception.LdapException - If the operation failedvoid add(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The added valueentryId - The entry ID pointed by the added valueorg.apache.directory.api.ldap.model.exception.LdapException - If the addition can't be donevoid drop(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
[entryId, [top, person, inetOrgPerson]]and the forward index will contain many entries like :
[top, [..., entryId, ...]] [person, [..., entryId, ...]] [inetOrgPerson, [..., entryId, ...]]So dropping the entryId means that we must first get all the values from the reverse index (and we will get [top, person, inetOrgPerson]) then to iterate through all those values to remove entryId from the associated list of entryIds.
partitionTxn - The transaction to useentryId - The master table entryId to removeorg.apache.directory.api.ldap.model.exception.LdapException - if we can't drop the element from the indexvoid drop(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The value we want to remove from the indexentryId - The associated IDorg.apache.directory.api.ldap.model.exception.LdapException - If the removal can't be doneorg.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,E>> forwardCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException - If the cursor can't be createdorg.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,E>> forwardCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K key) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to usekey - The key to start fromorg.apache.directory.api.ldap.model.exception.LdapException - If the cursor can't be createdorg.apache.directory.api.ldap.model.cursor.Cursor<K> reverseValueCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useentryId - The entry ID to start fromorg.apache.directory.api.ldap.model.exception.LdapException - If the cursor can't be createdorg.apache.directory.api.ldap.model.cursor.Cursor<E> forwardValueCursor(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K key) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to usekey - The key to start fromorg.apache.directory.api.ldap.model.exception.LdapException - If the cursor can't be createdboolean forward(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The key we want to start withorg.apache.directory.api.ldap.model.exception.LdapException - If we had an issue moving forwardboolean forward(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, K attrVal, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useattrVal - The key we want to start withentryId - The entry ID to start fromorg.apache.directory.api.ldap.model.exception.LdapException - If we had an issue moving forwardboolean reverse(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, E entryId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useentryId - The entry we want to start withorg.apache.directory.api.ldap.model.exception.LdapException - If we had an issue moving backwardboolean reverse(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn, E entryId, K attrVal) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn - The transaction to useentryId - The entry ID to start fromattrVal - The key we want to start withorg.apache.directory.api.ldap.model.exception.LdapException - If we had an issue moving backwardvoid close(org.apache.directory.server.core.api.partition.PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException, IOException
partitionTxn - The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException - If we weren't able to close the indexIOException - If we had an issue with the index fileboolean isDupsEnabled()
boolean hasReverse()
Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.