| 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 PageFile pageFile
protected long headPageId
protected long tailPageId
protected java.util.concurrent.atomic.AtomicBoolean loaded
public ListIndex()
public ListIndex(PageFile pageFile, long headPageId)
public void load(Transaction tx) throws java.io.IOException
Indexpublic void unload(Transaction tx)
Indexprotected ListNode<Key,Value> getHead(Transaction tx) throws java.io.IOException
java.io.IOExceptionprotected ListNode<Key,Value> getTail(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic boolean containsKey(Transaction tx, Key key) throws java.io.IOException
containsKey in interface Index<Key,Value>java.io.IOExceptionpublic 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.IOExceptionpublic Value addFirst(Transaction tx, Key key, Value value) throws java.io.IOException
java.io.IOExceptionpublic Value remove(Transaction tx, Key key) throws java.io.IOException
Indexpublic void onRemove()
public boolean isTransient()
isTransient in interface Index<Key,Value>public void clear(Transaction tx) throws java.io.IOException
Indexpublic java.util.Iterator<ListNode<Key,Value>> listNodeIterator(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic boolean isEmpty(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic 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.IOExceptionpublic java.util.Map.Entry<Key,Value> getFirst(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic java.util.Map.Entry<Key,Value> getLast(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic ListNode<Key,Value> createNode(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic void storeNode(Transaction tx, ListNode<Key,Value> node, boolean overflow) throws java.io.IOException
java.io.IOExceptionpublic 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)
IndexsetKeyMarshaller in interface Index<Key,Value>public Marshaller<Value> getValueMarshaller()
public void setValueMarshaller(Marshaller<Value> valueMarshaller)
IndexsetValueMarshaller in interface Index<Key,Value>public void setTailPageId(long tailPageId)
public long getTailPageId()
public long size()
Copyright © 2005-2016 Red Hat, Inc.. All Rights Reserved.