K
- The Indexed value type, used to retrieve an elementID
- The unique identifier type in the master tablepublic interface Index<K,ID>
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(K attrVal,
ID id)
Add an entry into the index, associated with the element ID.
|
void |
close() |
long |
count()
Gets the total scan count for this index.
|
long |
count(K attrVal)
Gets the scan count for the occurrence of a specific attribute value
within the index.
|
void |
drop(ID entryId)
Remove all the reference to an entry from the index.
|
void |
drop(K attrVal,
ID id)
Remove the pair
|
boolean |
forward(K attrVal) |
boolean |
forward(K attrVal,
ID id) |
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> |
forwardCursor() |
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> |
forwardCursor(K key) |
ID |
forwardLookup(K attrVal) |
org.apache.directory.api.ldap.model.cursor.Cursor<ID> |
forwardValueCursor(K 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(K attrVal) |
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(K attrVal) |
boolean |
reverse(ID id) |
boolean |
reverse(ID id,
K attrVal) |
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> |
reverseCursor() |
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> |
reverseCursor(ID id) |
K |
reverseLookup(ID id) |
org.apache.directory.api.ldap.model.cursor.Cursor<K> |
reverseValueCursor(ID 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.
|
void |
sync() |
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() throws Exception
Exception
- on failure to access index db fileslong count(K attrVal) throws Exception
attrVal
- the value of the attribute to get a scan count forException
- on failure to access index db filesK reverseLookup(ID id) throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
void add(K attrVal, ID id) throws Exception
attrVal
- The added valueid
- The element ID pointed by the added valueException
- If the addition can't be donevoid drop(ID entryId) throws Exception
[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.
entryId
- The master table entry ID to removeException
void drop(K attrVal, ID id) throws Exception
attrVal
- The value we want to remove from the indexid
- The associated IDException
- If the removal can't be doneorg.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> reverseCursor() throws Exception
Exception
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> forwardCursor() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> reverseCursor(ID id) throws Exception
Exception
org.apache.directory.api.ldap.model.cursor.Cursor<IndexEntry<K,ID>> forwardCursor(K key) throws Exception
Exception
org.apache.directory.api.ldap.model.cursor.Cursor<K> reverseValueCursor(ID id) throws Exception
Exception
org.apache.directory.api.ldap.model.cursor.Cursor<ID> forwardValueCursor(K key) throws Exception
Exception
boolean forward(K attrVal, ID id) throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
boolean isDupsEnabled()
boolean hasReverse()
Copyright © 2018. All rights reserved.