org.apache.kahadb.index
Class BTreeNode<Key,Value>
java.lang.Object
org.apache.kahadb.index.BTreeNode<Key,Value>
public final class BTreeNode<Key,Value>
- extends Object
The BTreeNode class represents a node in the BTree object graph. It is stored in
one Page of a PageFile.
Nested Class Summary |
static class |
BTreeNode.Marshaller<Key,Value>
The Marshaller is used to store and load the data in the BTreeNode into a Page. |
Method Summary |
void |
clear(Transaction tx)
|
boolean |
contains(Transaction tx,
Key key)
|
Value |
get(Transaction tx,
Key key)
|
Map.Entry<Key,Value> |
getFirst(Transaction tx)
|
BTreeNode<Key,Value> |
getFirstLeafNode(Transaction tx)
|
Map.Entry<Key,Value> |
getLast(Transaction tx)
|
int |
getMaxLeafDepth(Transaction tx,
int depth)
|
int |
getMinLeafDepth(Transaction tx,
int depth)
|
long |
getNext()
|
Page<BTreeNode<Key,Value>> |
getPage()
|
long |
getPageId()
|
BTreeNode<Key,Value> |
getParent()
|
boolean |
isEmpty(Transaction tx)
|
Iterator<Map.Entry<Key,Value>> |
iterator(Transaction tx)
|
Iterator<Map.Entry<Key,Value>> |
iterator(Transaction tx,
Key startKey)
|
void |
printStructure(Transaction tx,
PrintWriter out,
String prefix)
|
Value |
put(Transaction tx,
Key key,
Value value)
|
Value |
remove(Transaction tx,
Key key)
|
void |
setEmpty()
|
void |
setNext(long next)
|
void |
setPage(Page<BTreeNode<Key,Value>> page)
|
void |
setParent(BTreeNode<Key,Value> parent)
|
String |
toString()
|
void |
visit(Transaction tx,
BTreeVisitor<Key,Value> visitor)
|
BTreeNode
public BTreeNode(BTreeIndex<Key,Value> index)
setEmpty
public void setEmpty()
remove
public Value remove(Transaction tx,
Key key)
throws IOException
- Throws:
IOException
put
public Value put(Transaction tx,
Key key,
Value value)
throws IOException
- Throws:
IOException
printStructure
public void printStructure(Transaction tx,
PrintWriter out,
String prefix)
throws IOException
- Throws:
IOException
getMinLeafDepth
public int getMinLeafDepth(Transaction tx,
int depth)
throws IOException
- Throws:
IOException
getMaxLeafDepth
public int getMaxLeafDepth(Transaction tx,
int depth)
throws IOException
- Throws:
IOException
get
public Value get(Transaction tx,
Key key)
throws IOException
- Throws:
IOException
isEmpty
public boolean isEmpty(Transaction tx)
throws IOException
- Throws:
IOException
visit
public void visit(Transaction tx,
BTreeVisitor<Key,Value> visitor)
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
getFirstLeafNode
public BTreeNode<Key,Value> getFirstLeafNode(Transaction tx)
throws IOException
- Throws:
IOException
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Transaction tx,
Key startKey)
throws IOException
- Throws:
IOException
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Transaction tx)
throws IOException
- Throws:
IOException
clear
public void clear(Transaction tx)
throws IOException
- Throws:
IOException
contains
public boolean contains(Transaction tx,
Key key)
throws IOException
- Throws:
IOException
getPageId
public long getPageId()
getParent
public BTreeNode<Key,Value> getParent()
setParent
public void setParent(BTreeNode<Key,Value> parent)
getPage
public Page<BTreeNode<Key,Value>> getPage()
setPage
public void setPage(Page<BTreeNode<Key,Value>> page)
getNext
public long getNext()
setNext
public void setNext(long next)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.