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