Class ListIndex<Key,Value>
- java.lang.Object
-
- org.apache.activemq.store.kahadb.disk.index.ListIndex<Key,Value>
-
-
Field Summary
Fields Modifier and Type Field Description protected longheadPageIdprotected AtomicBooleanloadedstatic longNOT_SETprotected PageFilepageFileprotected longtailPageId
-
Method Summary
-
-
-
Field Detail
-
NOT_SET
public static final long NOT_SET
- See Also:
- Constant Field Values
-
pageFile
protected PageFile pageFile
-
headPageId
protected long headPageId
-
tailPageId
protected long tailPageId
-
loaded
protected AtomicBoolean loaded
-
-
Method Detail
-
load
public void load(Transaction tx) throws IOException
Description copied from interface:Indexload indexes- Specified by:
loadin interfaceIndex<Key,Value>- Throws:
IOException
-
onLoad
protected void onLoad(ListNode<Key,Value> node, Transaction tx)
-
unload
public void unload(Transaction tx)
Description copied from interface:Indexunload indexes
-
getHead
protected ListNode<Key,Value> getHead(Transaction tx) throws IOException
- Throws:
IOException
-
getTail
protected ListNode<Key,Value> getTail(Transaction tx) throws IOException
- Throws:
IOException
-
containsKey
public boolean containsKey(Transaction tx, Key key) throws IOException
- Specified by:
containsKeyin interfaceIndex<Key,Value>- Returns:
- true if it contains the key
- Throws:
IOException
-
get
public Value get(Transaction tx, Key key) throws IOException
- Specified by:
getin interfaceIndex<Key,Value>- Returns:
- the entry
- Throws:
IOException
-
put
public Value put(Transaction tx, Key key, Value value) throws IOException
Update the value of the item with the given key in the list if ot exists, otherwise it appends the value to the end of the list.- Specified by:
putin interfaceIndex<Key,Value>- Returns:
- the old value contained in the list if one exists or null.
- Throws:
IOException
-
add
public Value add(Transaction tx, Key key, Value value) throws IOException
- Throws:
IOException
-
addFirst
public Value addFirst(Transaction tx, Key key, Value value) throws IOException
- Throws:
IOException
-
remove
public Value remove(Transaction tx, Key key) throws IOException
Description copied from interface:Indexremove the index key- Specified by:
removein interfaceIndex<Key,Value>- Returns:
- StoreEntry removed
- Throws:
IOException
-
isTransient
public boolean isTransient()
- Specified by:
isTransientin interfaceIndex<Key,Value>- Returns:
- true if the index is transient
-
clear
public void clear(Transaction tx) throws IOException
Description copied from interface:Indexclear the index- Specified by:
clearin interfaceIndex<Key,Value>- Throws:
IOException
-
listNodeIterator
public Iterator<ListNode<Key,Value>> listNodeIterator(Transaction tx) throws IOException
- Throws:
IOException
-
isEmpty
public boolean isEmpty(Transaction tx) throws IOException
- Throws:
IOException
-
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Transaction tx) throws IOException
- Specified by:
iteratorin interfaceIndex<Key,Value>- Returns:
- Throws:
IOException
-
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Transaction tx, long initialPosition) throws IOException
- Throws:
IOException
-
getFirst
public Map.Entry<Key,Value> getFirst(Transaction tx) throws IOException
- Throws:
IOException
-
getLast
public Map.Entry<Key,Value> getLast(Transaction tx) throws IOException
- Throws:
IOException
-
createNode
public ListNode<Key,Value> createNode(Transaction tx) throws IOException
- Throws:
IOException
-
storeNode
public void storeNode(Transaction tx, ListNode<Key,Value> node, boolean overflow) throws IOException
- Throws:
IOException
-
getPageFile
public PageFile getPageFile()
-
setPageFile
public void setPageFile(PageFile pageFile)
-
getHeadPageId
public long getHeadPageId()
-
setHeadPageId
public void setHeadPageId(long headPageId)
-
getKeyMarshaller
public Marshaller<Key> getKeyMarshaller()
-
setKeyMarshaller
public void setKeyMarshaller(Marshaller<Key> keyMarshaller)
Description copied from interface:IndexSet the marshaller for key objects- Specified by:
setKeyMarshallerin interfaceIndex<Key,Value>
-
getValueMarshaller
public Marshaller<Value> getValueMarshaller()
-
setValueMarshaller
public void setValueMarshaller(Marshaller<Value> valueMarshaller)
Description copied from interface:IndexSet the marshaller for key objects- Specified by:
setValueMarshallerin interfaceIndex<Key,Value>
-
setTailPageId
public void setTailPageId(long tailPageId)
-
getTailPageId
public long getTailPageId()
-
size
public long size()
-
-