public class BTreeFactory extends Object
Constructor and Description |
---|
BTreeFactory() |
Modifier and Type | Method and Description |
---|---|
static <K,V> BTree<K,V> |
createBTree()
Create a new BTree.
|
static <K,V> org.apache.directory.mavibot.btree.memory.Leaf<K,V> |
createLeaf(BTree<K,V> btree,
long revision,
int nbElems)
Create a new Leaf for the give BTree.
|
static <K,V> org.apache.directory.mavibot.btree.memory.Node<K,V> |
createNode(BTree<K,V> btree,
long revision,
int nbElems)
Create a new Node for the give BTree.
|
static <K,V> LinkedList<ParentPos<K,V>> |
getPathToRightMostLeaf(BTree<K,V> btree)
Includes the intermediate nodes in the path up to and including the right most leaf of the tree
|
static <K,V> Page<K,V> |
getRoot(BTree<K,V> btree)
Return the BTree root page
|
static <K,V> void |
setKey(Page<K,V> page,
int pos,
K key)
Set the key at a give position
|
static <K,V> void |
setKeySerializer(BTree<K,V> btree,
String keySerializerFqcn)
Sets the KeySerializer into the BTree
|
static <K,V> void |
setName(BTree<K,V> btree,
String name) |
static <K,V> void |
setNbElems(BTree<K,V> btree,
long nbElems) |
static <K,V> void |
setNextBTreeOffset(BTree<K,V> btree,
long nextBTreeOffset) |
static <K,V> void |
setPageSize(BTree<K,V> btree,
int pageSize)
Set the maximum number of elements we can store in a page.
|
static <K,V> void |
setRevision(BTree<K,V> btree,
long revision) |
static <K,V> void |
setRoot(BTree<K,V> btree,
Page<K,V> root)
Set the new root page for this tree.
|
static <K,V> void |
setRootPageOffset(BTree<K,V> btree,
long rootPageOffset) |
static <K,V> void |
setValue(org.apache.directory.mavibot.btree.memory.Leaf<K,V> page,
int pos,
ValueHolder<V> value)
Set the value at a give position
|
static <K,V> void |
setValue(org.apache.directory.mavibot.btree.memory.Node<K,V> page,
int pos,
Page<K,V> value)
Set the value at a give position
|
static <K,V> void |
setValueSerializer(BTree<K,V> btree,
String valueSerializerFqcn)
Sets the ValueSerializer into the BTree
|
public static <K,V> BTree<K,V> createBTree()
public static <K,V> org.apache.directory.mavibot.btree.memory.Node<K,V> createNode(BTree<K,V> btree, long revision, int nbElems)
btree
- The BTree which will contain this noderevision
- The Node's revisionnbElems
- The number or elements in this nodepublic static <K,V> org.apache.directory.mavibot.btree.memory.Leaf<K,V> createLeaf(BTree<K,V> btree, long revision, int nbElems)
btree
- The BTree which will contain this leafrevision
- The Leaf's revisionnbElems
- The number or elements in this leafpublic static <K,V> void setRoot(BTree<K,V> btree, Page<K,V> root)
root
- the new root page.public static <K,V> Page<K,V> getRoot(BTree<K,V> btree)
btree
- The Btree we want to root page frompublic static <K,V> void setNbElems(BTree<K,V> btree, long nbElems)
nbElems
- the nbElems to setpublic static <K,V> void setRevision(BTree<K,V> btree, long revision)
revision
- the revision to setpublic static <K,V> void setRootPageOffset(BTree<K,V> btree, long rootPageOffset)
rootPageOffset
- the rootPageOffset to setpublic static <K,V> void setNextBTreeOffset(BTree<K,V> btree, long nextBTreeOffset)
nextBTreeOffset
- the nextBTreeOffset to setpublic static <K,V> void setName(BTree<K,V> btree, String name)
name
- the name to setpublic static <K,V> void setKeySerializer(BTree<K,V> btree, String keySerializerFqcn) throws ClassNotFoundException, IllegalAccessException, InstantiationException
btree
- The BTree to updatekeySerializerFqcn
- the Key serializer FQCN to setClassNotFoundException
InstantiationException
IllegalAccessException
public static <K,V> void setValueSerializer(BTree<K,V> btree, String valueSerializerFqcn) throws ClassNotFoundException, IllegalAccessException, InstantiationException
btree
- The BTree to updatevalueSerializerFqcn
- the Value serializer FQCN to setClassNotFoundException
InstantiationException
IllegalAccessException
public static <K,V> void setPageSize(BTree<K,V> btree, int pageSize)
pageSize
- The requested page sizepublic static <K,V> void setKey(Page<K,V> page, int pos, K key)
pos
- The position in the keys arraykey
- the key to injectpublic static <K,V> void setValue(org.apache.directory.mavibot.btree.memory.Leaf<K,V> page, int pos, ValueHolder<V> value)
pos
- The position in the values arrayvalue
- the value to injectpublic static <K,V> void setValue(org.apache.directory.mavibot.btree.memory.Node<K,V> page, int pos, Page<K,V> value)
pos
- The position in the values arrayvalue
- the value to injectpublic static <K,V> LinkedList<ParentPos<K,V>> getPathToRightMostLeaf(BTree<K,V> btree) throws IOException
btree
- the btreeIOException
Copyright © 2012-2013 Apache Mavibot Project Parent. All Rights Reserved.