|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.xdbm.AbstractIndex<K,O,Long>
org.apache.directory.server.xdbm.impl.avl.AvlIndex<K,O>
public class AvlIndex<K,O>
An Index backed by an AVL Tree.
| Field Summary | |
|---|---|
protected AvlTable<K,Long> |
forward
|
protected org.apache.directory.shared.ldap.model.schema.Normalizer |
normalizer
|
protected AvlTable<Long,K> |
reverse
|
| Fields inherited from class org.apache.directory.server.xdbm.AbstractIndex |
|---|
attributeId, attributeType, cacheSize, initialized |
| Fields inherited from interface org.apache.directory.server.xdbm.Index |
|---|
DEFAULT_INDEX_CACHE_SIZE |
| Constructor Summary | |
|---|---|
AvlIndex()
|
|
AvlIndex(String attributeId)
|
|
| Method Summary | |
|---|---|
void |
add(K attrVal,
Long id)
Add an entry into the index, associated with the element ID. |
void |
close()
|
int |
count()
Gets the total scan count for this index. |
int |
count(K attrVal)
Gets the scan count for the occurrence of a specific attribute value within the index. |
void |
drop(K attrVal,
Long id)
Remove the pair |
void |
drop(Long id)
Remove all the reference to an entry from the index. |
boolean |
forward(K attrVal)
|
boolean |
forward(K attrVal,
Long id)
|
IndexCursor<K,O,Long> |
forwardCursor()
|
IndexCursor<K,O,Long> |
forwardCursor(K key)
|
boolean |
forwardGreaterOrEq(K attrVal)
|
boolean |
forwardGreaterOrEq(K attrVal,
Long id)
|
boolean |
forwardLessOrEq(K attrVal)
|
boolean |
forwardLessOrEq(K attrVal,
Long id)
|
Long |
forwardLookup(K attrVal)
|
org.apache.directory.shared.ldap.model.cursor.Cursor<Long> |
forwardValueCursor(K key)
|
K |
getNormalized(K attrVal)
Gets the normalized value for an attribute. |
URI |
getWkDirPath()
this method always returns null for AvlIndex cause this is a in-memory index. |
int |
greaterThanCount(K attrVal)
|
void |
init(org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.shared.ldap.model.schema.AttributeType attributeType)
|
boolean |
isDupsEnabled()
tells whether the Index implementation supports storing duplicate keys |
int |
lessThanCount(K attrVal)
|
boolean |
reverse(Long id)
|
boolean |
reverse(Long id,
K attrVal)
|
IndexCursor<K,O,Long> |
reverseCursor()
|
IndexCursor<K,O,Long> |
reverseCursor(Long id)
|
boolean |
reverseGreaterOrEq(Long id)
|
boolean |
reverseGreaterOrEq(Long id,
K attrVal)
|
boolean |
reverseLessOrEq(Long id)
|
boolean |
reverseLessOrEq(Long id,
K attrVal)
|
K |
reverseLookup(Long id)
|
org.apache.directory.shared.ldap.model.cursor.Cursor<K> |
reverseValueCursor(Long id)
|
void |
setWkDirPath(URI wkDirPath)
throws UnsupportedOperationException cause it is a in-memory index |
void |
sync()
|
| Methods inherited from class org.apache.directory.server.xdbm.AbstractIndex |
|---|
getAttribute, getAttributeId, getCacheSize, protect, setAttributeId, setCacheSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.directory.shared.ldap.model.schema.Normalizer normalizer
protected AvlTable<K,Long> forward
protected AvlTable<Long,K> reverse
| Constructor Detail |
|---|
public AvlIndex()
public AvlIndex(String attributeId)
| Method Detail |
|---|
public void init(org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.shared.ldap.model.schema.AttributeType attributeType)
throws Exception
Exception
public void add(K attrVal,
Long id)
throws Exception
Index
attrVal - The added valueid - The element ID pointed by the added value
Exception - If the addition can't be done
public void close()
throws Exception
Exception
public int count()
throws Exception
Exception - on failure to access index db files
public int count(K attrVal)
throws Exception
attrVal - the value of the attribute to get a scan count for
Exception - on failure to access index db files
public void drop(Long id)
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.
id - The master table entry ID to remove
Exception
public void drop(K attrVal,
Long id)
throws Exception
attrVal - The value we want to remove from the indexid - The associated ID
Exception - If the removal can't be done
public boolean forward(K attrVal)
throws Exception
Exception
public boolean forward(K attrVal,
Long id)
throws Exception
Exception
public IndexCursor<K,O,Long> forwardCursor()
throws Exception
Exception
public IndexCursor<K,O,Long> forwardCursor(K key)
throws Exception
Exception
public boolean forwardGreaterOrEq(K attrVal)
throws Exception
Exception
public boolean forwardGreaterOrEq(K attrVal,
Long id)
throws Exception
Exception
public boolean forwardLessOrEq(K attrVal)
throws Exception
Exception
public boolean forwardLessOrEq(K attrVal,
Long id)
throws Exception
Exception
public Long forwardLookup(K attrVal)
throws Exception
Exception
public org.apache.directory.shared.ldap.model.cursor.Cursor<Long> forwardValueCursor(K key)
throws Exception
Exception
public K getNormalized(K attrVal)
throws Exception
attrVal - the user provided value to normalize
Exception - if something goes wrong.
public int greaterThanCount(K attrVal)
throws Exception
Exception
public int lessThanCount(K attrVal)
throws Exception
Exception
public boolean reverse(Long id)
throws Exception
Exception
public boolean reverse(Long id,
K attrVal)
throws Exception
Exception
public IndexCursor<K,O,Long> reverseCursor()
throws Exception
Exception
public IndexCursor<K,O,Long> reverseCursor(Long id)
throws Exception
Exception
public boolean reverseGreaterOrEq(Long id)
throws Exception
Exception
public boolean reverseGreaterOrEq(Long id,
K attrVal)
throws Exception
Exception
public boolean reverseLessOrEq(Long id)
throws Exception
Exception
public boolean reverseLessOrEq(Long id,
K attrVal)
throws Exception
Exception
public K reverseLookup(Long id)
throws Exception
Exception
public org.apache.directory.shared.ldap.model.cursor.Cursor<K> reverseValueCursor(Long id)
throws Exception
Exceptionpublic void setWkDirPath(URI wkDirPath)
wkDirPath - optional working directory pathpublic URI getWkDirPath()
public boolean isDupsEnabled()
isDupsEnabled in interface Index<K,O,Long>isDupsEnabled in class AbstractIndex<K,O,Long>
public void sync()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||