Modifier and Type | Field and Description |
---|---|
protected long |
headPageId |
protected java.util.concurrent.atomic.AtomicBoolean |
loaded |
static long |
NOT_SET |
protected PageFile |
pageFile |
protected long |
tailPageId |
Constructor and Description |
---|
ListIndex() |
ListIndex(PageFile pageFile,
long headPageId) |
ListIndex(PageFile pageFile,
Page page) |
Modifier and Type | Method and Description |
---|---|
Value |
add(Transaction tx,
Key key,
Value value) |
Value |
addFirst(Transaction tx,
Key key,
Value value) |
void |
clear(Transaction tx)
clear the index
|
boolean |
containsKey(Transaction tx,
Key key) |
ListNode<Key,Value> |
createNode(Transaction tx) |
Value |
get(Transaction tx,
Key key) |
java.util.Map.Entry<Key,Value> |
getFirst(Transaction tx) |
protected ListNode<Key,Value> |
getHead(Transaction tx) |
long |
getHeadPageId() |
Marshaller<Key> |
getKeyMarshaller() |
java.util.Map.Entry<Key,Value> |
getLast(Transaction tx) |
PageFile |
getPageFile() |
protected ListNode<Key,Value> |
getTail(Transaction tx) |
long |
getTailPageId() |
Marshaller<Value> |
getValueMarshaller() |
boolean |
isEmpty(Transaction tx) |
boolean |
isTransient() |
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx) |
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx,
long initialPosition) |
java.util.Iterator<ListNode<Key,Value>> |
listNodeIterator(Transaction tx) |
void |
load(Transaction tx)
load indexes
|
void |
onRemove() |
Value |
put(Transaction tx,
Key key,
Value value)
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.
|
Value |
remove(Transaction tx,
Key key)
remove the index key
|
void |
setHeadPageId(long headPageId) |
void |
setKeyMarshaller(Marshaller<Key> keyMarshaller)
Set the marshaller for key objects
|
void |
setPageFile(PageFile pageFile) |
void |
setTailPageId(long tailPageId) |
void |
setValueMarshaller(Marshaller<Value> valueMarshaller)
Set the marshaller for key objects
|
long |
size() |
void |
storeNode(Transaction tx,
ListNode<Key,Value> node,
boolean overflow) |
void |
unload(Transaction tx)
unload indexes
|
public static final long NOT_SET
protected long headPageId
protected long tailPageId
protected java.util.concurrent.atomic.AtomicBoolean loaded
public ListIndex()
public void load(Transaction tx) throws java.io.IOException
Index
public void unload(Transaction tx)
Index
protected ListNode<Key,Value> getHead(Transaction tx) throws java.io.IOException
java.io.IOException
protected ListNode<Key,Value> getTail(Transaction tx) throws java.io.IOException
java.io.IOException
public boolean containsKey(Transaction tx, Key key) throws java.io.IOException
containsKey
in interface Index<Key,Value>
java.io.IOException
public Value get(Transaction tx, Key key) throws java.io.IOException
public Value put(Transaction tx, Key key, Value value) throws java.io.IOException
public Value add(Transaction tx, Key key, Value value) throws java.io.IOException
java.io.IOException
public Value addFirst(Transaction tx, Key key, Value value) throws java.io.IOException
java.io.IOException
public Value remove(Transaction tx, Key key) throws java.io.IOException
Index
public void onRemove()
public boolean isTransient()
isTransient
in interface Index<Key,Value>
public void clear(Transaction tx) throws java.io.IOException
Index
public java.util.Iterator<ListNode<Key,Value>> listNodeIterator(Transaction tx) throws java.io.IOException
java.io.IOException
public boolean isEmpty(Transaction tx) throws java.io.IOException
java.io.IOException
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx) throws java.io.IOException
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx, long initialPosition) throws java.io.IOException
java.io.IOException
public java.util.Map.Entry<Key,Value> getFirst(Transaction tx) throws java.io.IOException
java.io.IOException
public java.util.Map.Entry<Key,Value> getLast(Transaction tx) throws java.io.IOException
java.io.IOException
public ListNode<Key,Value> createNode(Transaction tx) throws java.io.IOException
java.io.IOException
public void storeNode(Transaction tx, ListNode<Key,Value> node, boolean overflow) throws java.io.IOException
java.io.IOException
public PageFile getPageFile()
public void setPageFile(PageFile pageFile)
public long getHeadPageId()
public void setHeadPageId(long headPageId)
public Marshaller<Key> getKeyMarshaller()
public void setKeyMarshaller(Marshaller<Key> keyMarshaller)
Index
setKeyMarshaller
in interface Index<Key,Value>
public Marshaller<Value> getValueMarshaller()
public void setValueMarshaller(Marshaller<Value> valueMarshaller)
Index
setValueMarshaller
in interface Index<Key,Value>
public void setTailPageId(long tailPageId)
public long getTailPageId()
public long size()
Copyright © 2005-2017. All Rights Reserved.