|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
K - The Indexed value type, used to retrieve an elementO - The indexed element type, when retrievedID - The unique identifier type in the master tablepublic interface Index<K,O,ID>
An index used to retrieve elements into the master table. Each stored element that is
indexed has a unique identifier (ID). We may have more than one element associated with
a value (K). We may cache the retrieved element (O).
Cursors over indices can also be gotten to traverse the
values of the index.
| Field Summary | |
|---|---|
static int |
DEFAULT_INDEX_CACHE_SIZE
The default cache size (ie, the number of elements we stored in the cache) |
| Method Summary | |
|---|---|
void |
add(K attrVal,
ID 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(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)
|
IndexCursor<K,O,ID> |
forwardCursor()
|
IndexCursor<K,O,ID> |
forwardCursor(K key)
|
boolean |
forwardGreaterOrEq(K attrVal)
|
boolean |
forwardGreaterOrEq(K attrVal,
ID id)
|
boolean |
forwardLessOrEq(K attrVal)
|
boolean |
forwardLessOrEq(K attrVal,
ID id)
|
ID |
forwardLookup(K attrVal)
|
org.apache.directory.shared.ldap.model.cursor.Cursor<ID> |
forwardValueCursor(K key)
|
org.apache.directory.shared.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. |
K |
getNormalized(K attrVal)
Gets the normalized value for an attribute. |
URI |
getWkDirPath()
Gets the working directory path to something other than the default. |
int |
greaterThanCount(K attrVal)
|
boolean |
isDupsEnabled()
tells whether the Index implementation supports storing duplicate keys |
int |
lessThanCount(K attrVal)
|
boolean |
reverse(ID id)
|
boolean |
reverse(ID id,
K attrVal)
|
IndexCursor<K,O,ID> |
reverseCursor()
|
IndexCursor<K,O,ID> |
reverseCursor(ID id)
|
boolean |
reverseGreaterOrEq(ID id)
|
boolean |
reverseGreaterOrEq(ID id,
K attrVal)
|
boolean |
reverseLessOrEq(ID id)
|
boolean |
reverseLessOrEq(ID id,
K attrVal)
|
K |
reverseLookup(ID id)
|
org.apache.directory.shared.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()
|
| Field Detail |
|---|
static final int DEFAULT_INDEX_CACHE_SIZE
| Method Detail |
|---|
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.shared.ldap.model.schema.AttributeType getAttribute()
K getNormalized(K attrVal)
throws Exception
attrVal - the user provided value to normalize
Exception - if something goes wrong.
int count()
throws Exception
Exception - on failure to access index db files
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
int greaterThanCount(K attrVal)
throws Exception
Exception
int lessThanCount(K attrVal)
throws Exception
Exception
ID forwardLookup(K attrVal)
throws Exception
Exception
K reverseLookup(ID id)
throws Exception
Exception
void add(K attrVal,
ID id)
throws Exception
attrVal - The added valueid - The element ID pointed by the added value
Exception - If the addition can't be done
void 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 remove
Exception
void drop(K attrVal,
ID id)
throws Exception
attrVal - The value we want to remove from the indexid - The associated ID
Exception - If the removal can't be done
IndexCursor<K,O,ID> reverseCursor()
throws Exception
Exception
IndexCursor<K,O,ID> forwardCursor()
throws Exception
Exception
IndexCursor<K,O,ID> reverseCursor(ID id)
throws Exception
Exception
IndexCursor<K,O,ID> forwardCursor(K key)
throws Exception
Exception
org.apache.directory.shared.ldap.model.cursor.Cursor<K> reverseValueCursor(ID id)
throws Exception
Exception
org.apache.directory.shared.ldap.model.cursor.Cursor<ID> forwardValueCursor(K key)
throws Exception
Exception
boolean forward(K attrVal)
throws Exception
Exception
boolean forward(K attrVal,
ID id)
throws Exception
Exception
boolean reverse(ID id)
throws Exception
Exception
boolean reverse(ID id,
K attrVal)
throws Exception
Exception
boolean forwardGreaterOrEq(K attrVal)
throws Exception
Exception
boolean forwardGreaterOrEq(K attrVal,
ID id)
throws Exception
Exception
boolean reverseGreaterOrEq(ID id)
throws Exception
Exception
boolean reverseGreaterOrEq(ID id,
K attrVal)
throws Exception
Exception
boolean forwardLessOrEq(K attrVal)
throws Exception
Exception
boolean forwardLessOrEq(K attrVal,
ID id)
throws Exception
Exception
boolean reverseLessOrEq(ID id)
throws Exception
Exception
boolean reverseLessOrEq(ID id,
K attrVal)
throws Exception
Exception
void close()
throws Exception
Exception
void sync()
throws Exception
Exceptionboolean isDupsEnabled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||