Class HashIndex<Key,Value>
java.lang.Object
org.apache.activemq.store.kahadb.disk.index.HashIndex<Key,Value>
- All Implemented Interfaces:
Index<Key,Value>
BTree implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(Transaction tx) clear the indexbooleancontainsKey(Transaction tx, Key key) get(Transaction tx, Key key) intintlongintintbooleaniterator(Transaction tx) voidload(Transaction tx) load indexesput(Transaction tx, Key key, Value value) store the key, itemremove(Transaction tx, Key key) remove the index keyvoidsetBinCapacity(int binCapacity) voidsetKeyMarshaller(Marshaller<Key> marshaller) Set the marshaller for key objectsvoidsetLoadFactor(int loadFactor) intvoidsetMaximumBinCapacity(int maximumCapacity) voidsetValueMarshaller(Marshaller<Value> valueMarshaller) Set the marshaller for value objectsintsize(Transaction tx) voidstore(Transaction tx, org.apache.activemq.store.kahadb.disk.index.HashBin<Key, Value> bin) toString()voidunload(Transaction tx) unload indexes
-
Field Details
-
CLOSED_STATE
public static final int CLOSED_STATE- See Also:
-
OPEN_STATE
public static final int OPEN_STATE- See Also:
-
DEFAULT_BIN_CAPACITY
public static final int DEFAULT_BIN_CAPACITY -
DEFAULT_MAXIMUM_BIN_CAPACITY
public static final int DEFAULT_MAXIMUM_BIN_CAPACITY -
DEFAULT_MINIMUM_BIN_CAPACITY
public static final int DEFAULT_MINIMUM_BIN_CAPACITY -
DEFAULT_LOAD_FACTOR
public static final int DEFAULT_LOAD_FACTOR
-
-
Constructor Details
-
HashIndex
Constructor- Parameters:
pageFile-pageId-- Throws:
IOException
-
-
Method Details
-
load
Description copied from interface:Indexload indexes- Specified by:
loadin interfaceIndex<Key,Value> - Throws:
IOException
-
unload
Description copied from interface:Indexunload indexes- Specified by:
unloadin interfaceIndex<Key,Value> - Throws:
IOException
-
get
- Specified by:
getin interfaceIndex<Key,Value> - Returns:
- the entry
- Throws:
IOException
-
containsKey
- Specified by:
containsKeyin interfaceIndex<Key,Value> - Returns:
- true if it contains the key
- Throws:
IOException
-
put
Description copied from interface:Indexstore the key, item- Specified by:
putin interfaceIndex<Key,Value> - Throws:
IOException
-
remove
Description copied from interface:Indexremove the index key- Specified by:
removein interfaceIndex<Key,Value> - Returns:
- StoreEntry removed
- Throws:
IOException
-
clear
Description copied from interface:Indexclear the index- Specified by:
clearin interfaceIndex<Key,Value> - Throws:
IOException
-
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Transaction tx) throws IOException, UnsupportedOperationException - Specified by:
iteratorin interfaceIndex<Key,Value> - Returns:
- Throws:
IOExceptionUnsupportedOperationException
-
toString
-
store
public void store(Transaction tx, org.apache.activemq.store.kahadb.disk.index.HashBin<Key, Value> bin) throws IOException- Throws:
IOException
-
getKeyMarshaller
-
setKeyMarshaller
Set the marshaller for key objects- Specified by:
setKeyMarshallerin interfaceIndex<Key,Value> - Parameters:
marshaller-
-
getValueMarshaller
-
setValueMarshaller
Set the marshaller for value objects- Specified by:
setValueMarshallerin interfaceIndex<Key,Value> - Parameters:
valueMarshaller-
-
getBinCapacity
public int getBinCapacity()- Returns:
- number of bins in the index
-
setBinCapacity
public void setBinCapacity(int binCapacity) - Parameters:
binCapacity-
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfaceIndex<Key,Value> - Returns:
- true if the index is transient
-
getLoadFactor
public int getLoadFactor()- Returns:
- the loadFactor
-
setLoadFactor
public void setLoadFactor(int loadFactor) - Parameters:
loadFactor- the loadFactor to set
-
setMaximumBinCapacity
public int setMaximumBinCapacity()- Returns:
- the maximumCapacity
-
setMaximumBinCapacity
public void setMaximumBinCapacity(int maximumCapacity) - Parameters:
maximumCapacity- the maximumCapacity to set
-
size
-
getActiveBins
public int getActiveBins() -
getBinPageId
public long getBinPageId() -
getPageFile
-
getBinsActive
public int getBinsActive()
-