Class BPlusLeafIndex
java.lang.Object
com.semedy.reasoner.edb.persistentstore.bplustree.BPlusNode<KeyType,KeyBufferType>
com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeaf<KeyType,KeyBufferType>
com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeafRecords<long[],TupleBuffer>
com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeafIndex
- All Implemented Interfaces:
CacheUnit
This type of bplus leaf contains a cache for the index values
- Author:
- angele
-
Nested Class Summary
Nested classes/interfaces inherited from class com.semedy.reasoner.edb.persistentstore.bplustree.BPlusNode
BPlusNode.BPlusStatus -
Constructor Summary
ConstructorsConstructorDescriptionBPlusLeafIndex(BPlusKeys<long[], TupleBuffer> keys, int nodelength, DataFile _bufferFile2, BPlusTree<long[], TupleBuffer> bplustree) BPlusLeafIndex(BPlusKeys<long[], TupleBuffer> keys, long[] records, int maxSizeInBytes, DataFile bufferfile, BPlusTree<long[], TupleBuffer> bplustree) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSanity(String message, long[] minKey, long[] maxKey, DataFile df) checks whether all keys are sorted correctlystatic BPlusLeafIndexcreateLeaf(byte[] bytes, KeysFactory<long[], TupleBuffer> keysFactory, DataFile bufferFile, BPlusTree<long[], TupleBuffer> bplustree) Method for creating a leaf from the given byte array.booleandelete(long[] key) delete a node and delete cached index valuesvoidperforms several cleaning up actions after borrowing from the right.voidperforms several cleanign up actions after borrowing from the left.getIndexBuffer(int index) return a buffer for the index values at node indexbooleaninsert(long[] key, long record) Insert a new node and delete cached index valuesvoidbooleanisKey(long[] key, int index) booleansearch4record(long record) Methods inherited from class com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeafRecords
append, borrowFirstRecord, borrowRecord, createBytes, createLeaf, destroy, getObjectSize, getRecord, getRecords, isLeaf, remove, search, searchBuffer, searchIndex, searchIndexBuffer, set, substituteMethods inherited from class com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeaf
replace, searchIndexToInsert, searchIndexToInsertByBufferMethods inherited from class com.semedy.reasoner.edb.persistentstore.bplustree.BPlusNode
borrowFirstKey, borrowKey, canBeBorrowedFrom, clear, detach, getFather, getIndexInFather, getKeys, getLast, getNext, getNumKeys, getOffset, getStatus, isEmpty, isFull, isReleasable, release, setFather, setLast, setNext, setStatus, sizeInBytes, toString, touch, underflow
-
Constructor Details
-
BPlusLeafIndex
public BPlusLeafIndex(BPlusKeys<long[], TupleBuffer> keys, long[] records, int maxSizeInBytes, DataFile bufferfile, BPlusTree<long[], TupleBuffer> bplustree) - Parameters:
keys-records-
-
BPlusLeafIndex
public BPlusLeafIndex(BPlusKeys<long[], TupleBuffer> keys, int nodelength, DataFile _bufferFile2, BPlusTree<long[], TupleBuffer> bplustree)
-
-
Method Details
-
checkSanity
Description copied from class:BPlusNodechecks whether all keys are sorted correctly- Overrides:
checkSanityin classBPlusLeaf<long[],TupleBuffer> - Returns:
-
search4record
public boolean search4record(long record) -
getIndexBuffer
return a buffer for the index values at node index- Overrides:
getIndexBufferin classBPlusLeafRecords<long[],TupleBuffer> - Throws:
IOException
-
insert
Insert a new node and delete cached index values- Overrides:
insertin classBPlusLeafRecords<long[],TupleBuffer> - Throws:
IOException
-
isKey
public boolean isKey(long[] key, int index) -
invalidate
public void invalidate() -
delete
public boolean delete(long[] key) delete a node and delete cached index values- Overrides:
deletein classBPlusLeafRecords<long[],TupleBuffer>
-
createLeaf
public static BPlusLeafIndex createLeaf(byte[] bytes, KeysFactory<long[], TupleBuffer> keysFactory, DataFile bufferFile, BPlusTree<long[], TupleBuffer> bplustree) Method for creating a leaf from the given byte array.- Parameters:
bytes-- Returns:
-
doneBorrowing
public void doneBorrowing()Description copied from class:BPlusNodeperforms several cleaning up actions after borrowing from the right.- Overrides:
doneBorrowingin classBPlusLeafRecords<long[],TupleBuffer>
-
doneBorrowingFirst
public void doneBorrowingFirst()Description copied from class:BPlusNodeperforms several cleanign up actions after borrowing from the left.- Overrides:
doneBorrowingFirstin classBPlusLeafRecords<long[],TupleBuffer>
-