|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex<K,O>
public class JdbmIndex<K,O>
A Jdbm based index implementation.
Field Summary | |
---|---|
protected int |
cacheSize
the size (number of index entries) for the cache |
static int |
DEFAULT_DUPLICATE_LIMIT
default duplicate limit before duplicate keys switch to using a btree for values |
protected JdbmTable<K,java.lang.Long> |
forward
the forward btree where the btree key is the value of the indexed attribute and the value of the btree is the entry id of the entry containing an attribute with that value |
static java.lang.String |
FORWARD_BTREE
the key used for the forward btree name |
protected boolean |
initialized
whether or not this index has been initialized |
protected org.apache.directory.shared.ldap.util.SynchronizedLRUMap |
keyCache
the normalized value cache for this index |
protected int |
numDupLimit
duplicate limit before duplicate keys switch to using a btree for values |
protected RecordManager |
recMan
the JDBM record manager for the file containing this index |
protected JdbmTable<java.lang.Long,K> |
reverse
the reverse btree where the btree key is the entry id of the entry containing a value for the indexed attribute, and the btree value is the value of the indexed attribute |
static java.lang.String |
REVERSE_BTREE
the key used for the reverse btree name |
protected java.io.File |
wkDirPath
a custom working directory path when specified in configuration |
Fields inherited from interface org.apache.directory.server.xdbm.Index |
---|
DEFAULT_INDEX_CACHE_SIZE |
Constructor Summary | |
---|---|
JdbmIndex()
|
|
JdbmIndex(java.lang.String attributeId)
|
Method Summary | |
---|---|
void |
add(K attrVal,
java.lang.Long id)
|
void |
close()
|
int |
count()
Gets the total scan count for this index. |
int |
count(K attrVal)
Gets the scan count for the occurance of a specific attribute value within the index. |
void |
drop(K attrVal,
java.lang.Long id)
|
void |
drop(java.lang.Long entryId)
Remove all the reference to an entry from the index. |
boolean |
forward(K attrVal)
|
boolean |
forward(K attrVal,
java.lang.Long id)
|
IndexCursor<K,O,java.lang.Long> |
forwardCursor()
|
IndexCursor<K,O,java.lang.Long> |
forwardCursor(K key)
|
boolean |
forwardGreaterOrEq(K attrVal)
|
boolean |
forwardGreaterOrEq(K attrVal,
java.lang.Long id)
|
boolean |
forwardLessOrEq(K attrVal)
|
boolean |
forwardLessOrEq(K attrVal,
java.lang.Long id)
|
java.lang.Long |
forwardLookup(K attrVal)
|
org.apache.directory.shared.ldap.cursor.Cursor<java.lang.Long> |
forwardValueCursor(K key)
|
org.apache.directory.shared.ldap.schema.AttributeType |
getAttribute()
Gets the attribute this Index is built upon. |
java.lang.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)
TODO I don't think the keyCache is required anymore since the normalizer will cache values for us. |
int |
getNumDupLimit()
Gets the threshold at which point duplicate keys use btree indirection to store their values. |
java.io.File |
getWkDirPath()
Gets the working directory path to something other than the default. |
int |
greaterThanCount(K attrVal)
|
void |
init(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager,
org.apache.directory.shared.ldap.schema.AttributeType attributeType,
java.io.File wkDirPath)
|
boolean |
isCountExact()
Checks whether or not calls to count the number of keys greater than or less than the key are exact. |
int |
lessThanCount(K attrVal)
|
boolean |
reverse(java.lang.Long id)
|
boolean |
reverse(java.lang.Long id,
K attrVal)
|
IndexCursor<K,O,java.lang.Long> |
reverseCursor()
|
IndexCursor<K,O,java.lang.Long> |
reverseCursor(java.lang.Long id)
|
boolean |
reverseGreaterOrEq(java.lang.Long id)
|
boolean |
reverseGreaterOrEq(java.lang.Long id,
K attrVal)
|
boolean |
reverseLessOrEq(java.lang.Long id)
|
boolean |
reverseLessOrEq(java.lang.Long id,
K attrVal)
|
K |
reverseLookup(java.lang.Long id)
|
org.apache.directory.shared.ldap.cursor.Cursor<K> |
reverseValueCursor(java.lang.Long id)
|
void |
setAttributeId(java.lang.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 |
setNumDupLimit(int numDupLimit)
Sets the threshold at which point duplicate keys use btree indirection to store their values. |
void |
setWkDirPath(java.io.File wkDirPath)
Sets the working directory path to something other than the default. |
void |
sync()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_DUPLICATE_LIMIT
public static final java.lang.String FORWARD_BTREE
public static final java.lang.String REVERSE_BTREE
protected JdbmTable<K,java.lang.Long> forward
protected JdbmTable<java.lang.Long,K> reverse
protected RecordManager recMan
protected org.apache.directory.shared.ldap.util.SynchronizedLRUMap keyCache
protected int cacheSize
protected int numDupLimit
protected boolean initialized
protected java.io.File wkDirPath
Constructor Detail |
---|
public JdbmIndex()
public JdbmIndex(java.lang.String attributeId)
Method Detail |
---|
public void init(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager, org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.io.File wkDirPath) throws java.io.IOException
java.io.IOException
public org.apache.directory.shared.ldap.schema.AttributeType getAttribute()
Index
getAttribute
in interface Index<K,O,java.lang.Long>
Index.getAttribute()
public boolean isCountExact()
Index
isCountExact
in interface Index<K,O,java.lang.Long>
public java.lang.String getAttributeId()
getAttributeId
in interface Index<K,O,java.lang.Long>
public void setAttributeId(java.lang.String attributeId)
setAttributeId
in interface Index<K,O,java.lang.Long>
attributeId
- configured attribute oid or alias namepublic int getNumDupLimit()
public void setNumDupLimit(int numDupLimit)
numDupLimit
- the threshold for storing a keys values in another btreepublic int getCacheSize()
getCacheSize
in interface Index<K,O,java.lang.Long>
public void setCacheSize(int cacheSize)
setCacheSize
in interface Index<K,O,java.lang.Long>
cacheSize
- the size of the index cachepublic void setWkDirPath(java.io.File wkDirPath)
setWkDirPath
in interface Index<K,O,java.lang.Long>
wkDirPath
- optional working directory pathpublic java.io.File getWkDirPath()
getWkDirPath
in interface Index<K,O,java.lang.Long>
public int count() throws java.io.IOException
Index
count
in interface Index<K,O,java.lang.Long>
java.io.IOException
Index.count()
public int count(K attrVal) throws java.lang.Exception
Index
count
in interface Index<K,O,java.lang.Long>
attrVal
- the value of the attribute to get a scan count for
java.lang.Exception
- on failure to access index db filesIndex.count(java.lang.Object)
public int greaterThanCount(K attrVal) throws java.lang.Exception
greaterThanCount
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public int lessThanCount(K attrVal) throws java.lang.Exception
lessThanCount
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index.lessThanCount(java.lang.Object)
public java.lang.Long forwardLookup(K attrVal) throws java.lang.Exception
forwardLookup
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index.forwardLookup(java.lang.Object)
public K reverseLookup(java.lang.Long id) throws java.lang.Exception
reverseLookup
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#reverseLookup(Long)
public void add(K attrVal, java.lang.Long id) throws java.lang.Exception
add
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index#add(Object, Long)
public void drop(K attrVal, java.lang.Long id) throws java.lang.Exception
drop
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index#drop(Object,Long)
public void drop(java.lang.Long entryId) throws java.lang.Exception
drop
in interface Index<K,O,java.lang.Long>
entryId
- The master table entry ID to remove
java.lang.Exception
public IndexCursor<K,O,java.lang.Long> reverseCursor() throws java.lang.Exception
reverseCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public IndexCursor<K,O,java.lang.Long> forwardCursor() throws java.lang.Exception
forwardCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public IndexCursor<K,O,java.lang.Long> reverseCursor(java.lang.Long id) throws java.lang.Exception
reverseCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public IndexCursor<K,O,java.lang.Long> forwardCursor(K key) throws java.lang.Exception
forwardCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public org.apache.directory.shared.ldap.cursor.Cursor<K> reverseValueCursor(java.lang.Long id) throws java.lang.Exception
reverseValueCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public org.apache.directory.shared.ldap.cursor.Cursor<java.lang.Long> forwardValueCursor(K key) throws java.lang.Exception
forwardValueCursor
in interface Index<K,O,java.lang.Long>
java.lang.Exception
public boolean forward(K attrVal) throws java.lang.Exception
forward
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index.forward(Object)
public boolean forward(K attrVal, java.lang.Long id) throws java.lang.Exception
forward
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index#forward(Object,Long)
public boolean reverse(java.lang.Long id) throws java.lang.Exception
reverse
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index#reverse(Long)
public boolean reverse(java.lang.Long id, K attrVal) throws java.lang.Exception
reverse
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index#reverse(Long,Object)
public boolean forwardGreaterOrEq(K attrVal) throws java.lang.Exception
forwardGreaterOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index.forwardGreaterOrEq(Object)
public boolean forwardGreaterOrEq(K attrVal, java.lang.Long id) throws java.lang.Exception
forwardGreaterOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#forwardGreaterOrEq(Object, Long)
public boolean forwardLessOrEq(K attrVal) throws java.lang.Exception
forwardLessOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
Index.forwardLessOrEq(Object)
public boolean forwardLessOrEq(K attrVal, java.lang.Long id) throws java.lang.Exception
forwardLessOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#forwardLessOrEq(Object, Long)
public boolean reverseGreaterOrEq(java.lang.Long id) throws java.lang.Exception
reverseGreaterOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#reverseGreaterOrEq(Long)
public boolean reverseGreaterOrEq(java.lang.Long id, K attrVal) throws java.lang.Exception
reverseGreaterOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#reverseGreaterOrEq(Long,Object)
public boolean reverseLessOrEq(java.lang.Long id) throws java.lang.Exception
reverseLessOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#reverseLessOrEq(Long)
public boolean reverseLessOrEq(java.lang.Long id, K attrVal) throws java.lang.Exception
reverseLessOrEq
in interface Index<K,O,java.lang.Long>
java.lang.Exception
org.apache.directory.server.xdbm.Index#reverseLessOrEq(Long,Object)
public void close() throws java.io.IOException
close
in interface Index<K,O,java.lang.Long>
java.io.IOException
Index.close()
public void sync() throws java.io.IOException
sync
in interface Index<K,O,java.lang.Long>
java.io.IOException
Index.sync()
public K getNormalized(K attrVal) throws java.lang.Exception
getNormalized
in interface Index<K,O,java.lang.Long>
attrVal
- the user provided value to normalize
java.lang.Exception
- if something goes wrong.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |