Modifier and Type | Field and Description |
---|---|
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,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 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<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 String |
REVERSE_BTREE
the key used for the reverse btree name
|
protected File |
wkDirPath
a custom working directory path when specified in configuration
|
DEFAULT_INDEX_CACHE_SIZE
Constructor and Description |
---|
JdbmIndex() |
JdbmIndex(String attributeId) |
Modifier and Type | Method and Description |
---|---|
void |
add(K attrVal,
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,
Long id) |
void |
drop(Long entryId)
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.cursor.Cursor<Long> |
forwardValueCursor(K key) |
org.apache.directory.shared.ldap.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)
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.
|
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,
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(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.cursor.Cursor<K> |
reverseValueCursor(Long 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 |
setNumDupLimit(int numDupLimit)
Sets the threshold at which point duplicate keys use btree indirection to store
their values.
|
void |
setWkDirPath(File wkDirPath)
Sets the working directory path to something other than the default.
|
void |
sync() |
String |
toString() |
public static final int DEFAULT_DUPLICATE_LIMIT
public static final String FORWARD_BTREE
public static final String REVERSE_BTREE
protected JdbmTable<K,Long> forward
protected JdbmTable<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 File wkDirPath
public JdbmIndex()
public JdbmIndex(String attributeId)
public void init(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager, org.apache.directory.shared.ldap.schema.AttributeType attributeType, File wkDirPath) throws IOException
IOException
public org.apache.directory.shared.ldap.schema.AttributeType getAttribute()
Index
getAttribute
in interface Index<K,O,Long>
Index.getAttribute()
public boolean isCountExact()
Index
isCountExact
in interface Index<K,O,Long>
public String getAttributeId()
getAttributeId
in interface Index<K,O,Long>
public void setAttributeId(String attributeId)
setAttributeId
in interface Index<K,O,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,Long>
public void setCacheSize(int cacheSize)
setCacheSize
in interface Index<K,O,Long>
cacheSize
- the size of the index cachepublic void setWkDirPath(File wkDirPath)
setWkDirPath
in interface Index<K,O,Long>
wkDirPath
- optional working directory pathpublic File getWkDirPath()
getWkDirPath
in interface Index<K,O,Long>
public int count() throws IOException
Index
count
in interface Index<K,O,Long>
IOException
Index.count()
public int count(K attrVal) throws Exception
Index
public int lessThanCount(K attrVal) throws Exception
lessThanCount
in interface Index<K,O,Long>
Exception
Index.lessThanCount(java.lang.Object)
public Long forwardLookup(K attrVal) throws Exception
forwardLookup
in interface Index<K,O,Long>
Exception
Index.forwardLookup(java.lang.Object)
public void drop(Long entryId) throws Exception
public IndexCursor<K,O,Long> reverseCursor() throws Exception
public IndexCursor<K,O,Long> forwardCursor() throws Exception
public org.apache.directory.shared.ldap.cursor.Cursor<K> reverseValueCursor(Long id) throws Exception
public org.apache.directory.shared.ldap.cursor.Cursor<Long> forwardValueCursor(K key) throws Exception
public boolean forwardGreaterOrEq(K attrVal) throws Exception
forwardGreaterOrEq
in interface Index<K,O,Long>
Exception
Index.forwardGreaterOrEq(Object)
public boolean forwardLessOrEq(K attrVal) throws Exception
forwardLessOrEq
in interface Index<K,O,Long>
Exception
Index.forwardLessOrEq(Object)
public void close() throws IOException
close
in interface Index<K,O,Long>
IOException
Index.close()
public void sync() throws IOException
sync
in interface Index<K,O,Long>
IOException
Index.sync()
public K getNormalized(K attrVal) throws Exception
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.