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 TypeMethodDescriptionboolean
checkSanity
(String message, long[] minKey, long[] maxKey, DataFile df) checks whether all keys are sorted correctlystatic BPlusLeafIndex
createLeaf
(byte[] bytes, KeysFactory<long[], TupleBuffer> keysFactory, DataFile bufferFile, BPlusTree<long[], TupleBuffer> bplustree) Method for creating a leaf from the given byte array.boolean
delete
(long[] key) delete a node and delete cached index valuesvoid
performs several cleaning up actions after borrowing from the right.void
performs several cleanign up actions after borrowing from the left.getIndexBuffer
(int index) return a buffer for the index values at node indexboolean
insert
(long[] key, long record) Insert a new node and delete cached index valuesvoid
boolean
isKey
(long[] key, int index) boolean
search4record
(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, substitute
Methods inherited from class com.semedy.reasoner.edb.persistentstore.bplustree.BPlusLeaf
replace, searchIndexToInsert, searchIndexToInsertByBuffer
Methods 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:BPlusNode
checks whether all keys are sorted correctly- Overrides:
checkSanity
in classBPlusLeaf<long[],
TupleBuffer> - Returns:
-
search4record
public boolean search4record(long record) -
getIndexBuffer
return a buffer for the index values at node index- Overrides:
getIndexBuffer
in classBPlusLeafRecords<long[],
TupleBuffer> - Throws:
IOException
-
insert
Insert a new node and delete cached index values- Overrides:
insert
in 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:
delete
in 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:BPlusNode
performs several cleaning up actions after borrowing from the right.- Overrides:
doneBorrowing
in classBPlusLeafRecords<long[],
TupleBuffer>
-
doneBorrowingFirst
public void doneBorrowingFirst()Description copied from class:BPlusNode
performs several cleanign up actions after borrowing from the left.- Overrides:
doneBorrowingFirst
in classBPlusLeafRecords<long[],
TupleBuffer>
-