Package db
Interface FieldKeyInteriorNode
-
- All Superinterfaces:
InteriorNode
public interface FieldKeyInteriorNode extends InteriorNode
FieldKeyInteriorNodedefines a common interface forFieldKeyNodeimplementations which are also anInteriorNode.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareKeyField(Field k, int keyIndex)Performs a fast in-place key comparison of the specified key value with a key stored within this node at the specified keyIndex.voiddelete()Delete this node and all child nodes.DataBuffergetBuffer()intgetBufferId()int[]getBufferReferences()Return all buffer IDs for those buffers which are children of this buffer.intgetKeyCount()FieldgetKeyField(int index)Get the key value at a specific index.intgetKeyIndex(Field key)Perform a binary search to locate the specified key and derive an index into the Buffer ID storage.db.FieldKeyRecordNodegetLeafNode(Field key)Get the leaf node which contains the specified key.db.FieldKeyRecordNodegetLeftmostLeafNode()Get the left-most leaf node within the tree.FieldKeyInteriorNodegetParent()db.FieldKeyRecordNodegetRightmostLeafNode()Get the right-most leaf node within the tree.booleanisConsistent(java.lang.String tableName, TaskMonitor monitor)Check the consistency of this node and all of its children.voidkeyChanged(Field oldKey, Field newKey, db.FieldKeyNode childNode)Callback method for when a child node's leftmost key changes.voidsetKeyCount(int cnt)Set the number of keys contained within this node.
-
-
-
Method Detail
-
keyChanged
void keyChanged(Field oldKey, Field newKey, db.FieldKeyNode childNode) throws java.io.IOException
Callback method for when a child node's leftmost key changes.- Parameters:
oldKey- previous leftmost key.newKey- new leftmost key.childNode- child node containing oldKey (null if not a VarKeyNode)- Throws:
java.io.IOException- if IO error occurs
-
getBufferId
int getBufferId()
- Returns:
- the data buffer ID associated with this node.
-
getBuffer
DataBuffer getBuffer()
- Returns:
- the data buffer associated with this node.
-
getKeyCount
int getKeyCount()
- Returns:
- the number of keys contained within this node.
-
setKeyCount
void setKeyCount(int cnt)
Set the number of keys contained within this node.- Parameters:
cnt- key count
-
getKeyField
Field getKeyField(int index) throws java.io.IOException
Get the key value at a specific index.- Parameters:
index- key index- Returns:
- key value
- Throws:
java.io.IOException- thrown if an IO error occurs
-
getKeyIndex
int getKeyIndex(Field key) throws java.io.IOException
Perform a binary search to locate the specified key and derive an index into the Buffer ID storage. This method is intended to find the insertion index or exact match for a child key. A negative value will be returned when an exact match is not found and may be transformed into an insertion index (insetIndex = -returnedIndex-1).- Parameters:
key- key to search for- Returns:
- int buffer ID index.
- Throws:
java.io.IOException- thrown if an IO error occurs
-
delete
void delete() throws java.io.IOExceptionDelete this node and all child nodes.- Throws:
java.io.IOException- thrown if IO error occurs
-
getBufferReferences
int[] getBufferReferences()
Return all buffer IDs for those buffers which are children of this buffer.- Returns:
- array of buffer IDs
-
isConsistent
boolean isConsistent(java.lang.String tableName, TaskMonitor monitor) throws java.io.IOException, CancelledExceptionCheck the consistency of this node and all of its children.- Parameters:
tableName- name of table containing this nodemonitor- task monitor- Returns:
- true if consistency check passed, else false
- Throws:
java.io.IOException- if IO error occuredCancelledException- if task cancelled
-
getParent
FieldKeyInteriorNode getParent()
- Returns:
- the parent node or null if this is the root
-
getLeafNode
db.FieldKeyRecordNode getLeafNode(Field key) throws java.io.IOException
Get the leaf node which contains the specified key.- Parameters:
key- key value- Returns:
- leaf node
- Throws:
java.io.IOException- thrown if an IO error occurs
-
getLeftmostLeafNode
db.FieldKeyRecordNode getLeftmostLeafNode() throws java.io.IOExceptionGet the left-most leaf node within the tree.- Returns:
- left-most leaf node.
- Throws:
java.io.IOException- thrown if IO error occurs
-
getRightmostLeafNode
db.FieldKeyRecordNode getRightmostLeafNode() throws java.io.IOExceptionGet the right-most leaf node within the tree.- Returns:
- right-most leaf node.
- Throws:
java.io.IOException- thrown if IO error occurs
-
compareKeyField
int compareKeyField(Field k, int keyIndex)
Performs a fast in-place key comparison of the specified key value with a key stored within this node at the specified keyIndex.- Parameters:
k- key value to be comparedkeyIndex- key index to another key within this node's buffer- Returns:
- comparison value, zero if equal, -1 if k has a value less than the store key, or +1 if k has a value greater than the stored key located at keyIndex.
-
-