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 IndexBlock
public void close() throws JasDBStorageException
close
in interface Block
JasDBStorageException
public LeaveBlock findLeaveBlock(LockIntentType intent, Key key) throws JasDBStorageException
findLeaveBlock
in interface IndexBlock
JasDBStorageException
public LeaveBlock findFirstLeaveBlock(LockIntentType intentType) throws JasDBStorageException
findFirstLeaveBlock
in interface IndexBlock
JasDBStorageException
protected void insertBlock(Key key, IndexBlock leftChildBlock, IndexBlock rightChildBlock) throws JasDBStorageException
JasDBStorageException
protected void addNodes(List<TreeNode> nodes, Key exclude, long parentBlock) throws JasDBStorageException
JasDBStorageException
protected void updateBlockPointer(Key replaceKey, long leftBlock, long rightBlock) throws JasDBStorageException
JasDBStorageException
protected void removeBlockPointer(Key minBlockValue, IndexBlock removedBlock) throws JasDBStorageException
JasDBStorageException
protected void handleBlockUnderflow() throws JasDBStorageException
JasDBStorageException
protected 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 IndexBlock
public long memorySize()
memorySize
in interface IndexBlock
public BlockTypes getType()
getType
in interface IndexBlock
public boolean isModified()
isModified
in interface IndexBlock
public void setModified(boolean modified)
public long getParentPointer()
getParentPointer
in interface IndexBlock
public void setParentPointer(long parentBlock)
setParentPointer
in interface IndexBlock
public long getPosition()
getPosition
in interface Block
public Key getFirst()
getFirst
in interface IndexBlock
public Key getLast()
getLast
in interface IndexBlock
public void reset()
reset
in interface IndexBlock
public ReadWriteLock getLockManager()
getLockManager
in interface IndexBlock
protected Key getMin() throws JasDBStorageException
JasDBStorageException
protected Key getMax() throws JasDBStorageException
JasDBStorageException
Copyright © 2015. All rights reserved.