public class TreeBlock extends Object implements IndexBlock
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
modified |
protected BlockPersister |
persister |
protected KeyOrderedTree<TreeNode> |
treeNodes |
| Constructor and Description |
|---|
TreeBlock(BlockPersister persister,
DataBlock dataBlock,
long parentPointer) |
TreeBlock(BlockPersister persister,
DataBlock dataBlock,
long parentPointer,
boolean modified) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKey(TreeNode node) |
protected void |
addNodes(List<TreeNode> nodes,
Key exclude,
long parentBlock) |
void |
close() |
LeaveBlock |
findFirstLeaveBlock(LockIntentType intentType) |
LeaveBlock |
findLeaveBlock(LockIntentType intent,
Key key) |
DataBlock |
getDataBlock() |
Key |
getFirst() |
Key |
getLast() |
protected long |
getLeftSibbling(TreeBlock block) |
ReadWriteLock |
getLockManager() |
protected Key |
getMax() |
protected Key |
getMin() |
OrderedBalancedTree<Key,TreeNode> |
getNodes() |
long |
getParentPointer() |
long |
getPosition() |
protected long |
getRightSibbling(TreeBlock block) |
BlockTypes |
getType() |
protected void |
handleBlockUnderflow() |
protected void |
insertBlock(Key key,
IndexBlock leftChildBlock,
IndexBlock rightChildBlock) |
boolean |
isModified() |
long |
memorySize() |
protected void |
removeBlockPointer(Key minBlockValue,
IndexBlock removedBlock) |
void |
reset() |
void |
setModified(boolean modified) |
void |
setParentPointer(long parentBlock) |
int |
size() |
protected void |
updateBlockPointer(Key replaceKey,
long leftBlock,
long rightBlock) |
protected final KeyOrderedTree<TreeNode> treeNodes
protected final BlockPersister persister
protected boolean modified
public TreeBlock(BlockPersister persister, DataBlock dataBlock, long parentPointer)
public TreeBlock(BlockPersister persister, DataBlock dataBlock, long parentPointer, boolean modified)
public DataBlock getDataBlock()
getDataBlock in interface IndexBlockpublic void close()
throws JasDBStorageException
close in interface BlockJasDBStorageExceptionpublic LeaveBlock findLeaveBlock(LockIntentType intent, Key key) throws JasDBStorageException
findLeaveBlock in interface IndexBlockJasDBStorageExceptionpublic LeaveBlock findFirstLeaveBlock(LockIntentType intentType) throws JasDBStorageException
findFirstLeaveBlock in interface IndexBlockJasDBStorageExceptionprotected void insertBlock(Key key, IndexBlock leftChildBlock, IndexBlock rightChildBlock) throws JasDBStorageException
JasDBStorageExceptionprotected void addNodes(List<TreeNode> nodes, Key exclude, long parentBlock) throws JasDBStorageException
JasDBStorageExceptionprotected void updateBlockPointer(Key replaceKey, long leftBlock, long rightBlock) throws JasDBStorageException
JasDBStorageExceptionprotected void removeBlockPointer(Key minBlockValue, IndexBlock removedBlock) throws JasDBStorageException
JasDBStorageExceptionprotected void handleBlockUnderflow()
throws JasDBStorageException
JasDBStorageExceptionprotected long getLeftSibbling(TreeBlock block)
protected long getRightSibbling(TreeBlock block)
public void addKey(TreeNode node)
public OrderedBalancedTree<Key,TreeNode> getNodes()
public int size()
size in interface IndexBlockpublic long memorySize()
memorySize in interface IndexBlockpublic BlockTypes getType()
getType in interface IndexBlockpublic boolean isModified()
isModified in interface IndexBlockpublic void setModified(boolean modified)
public long getParentPointer()
getParentPointer in interface IndexBlockpublic void setParentPointer(long parentBlock)
setParentPointer in interface IndexBlockpublic long getPosition()
getPosition in interface Blockpublic Key getFirst()
getFirst in interface IndexBlockpublic Key getLast()
getLast in interface IndexBlockpublic void reset()
reset in interface IndexBlockpublic ReadWriteLock getLockManager()
getLockManager in interface IndexBlockprotected Key getMin() throws JasDBStorageException
JasDBStorageExceptionprotected Key getMax() throws JasDBStorageException
JasDBStorageExceptionCopyright © 2015. All rights reserved.