public class MutableNodeData extends Object implements INodeData
INodeData
record which operate by direct manipulation of the Java objects.
Note: package private fields are used so that they may be directly accessed
by the Node
class.
Constructor and Description |
---|
MutableNodeData(int branchingFactor,
boolean hasVersionTimestamps)
Create an empty mutable data record.
|
MutableNodeData(int branchingFactor,
INodeData src)
Makes a mutable copy of the source data record.
|
MutableNodeData(long nentries,
IRaba keys,
long[] childAddr,
long[] childEntryCounts,
boolean hasVersionTimestamps,
long minimumVersionTimestamp,
long maximumVersionTimestamp)
Ctor based on just the "data" -- used by unit tests.
|
Modifier and Type | Method and Description |
---|---|
AbstractFixedByteArrayBuffer |
data()
The coded (aka compressed) data.
|
long |
getChildAddr(int index)
Return the persistent addresses of the specified child node.
|
int |
getChildCount()
The #of children of this node.
|
long |
getChildEntryCount(int index)
Return the #of tuples spanned by the indicated child of this node.
|
int |
getKeyCount()
Return the #of keys in the node or leaf.
|
IRaba |
getKeys()
The object used to contain and manage the keys.
|
long |
getMaximumVersionTimestamp()
The most recent tuple revision timestamp associated with any tuple
spanned by this node or leaf.
|
long |
getMinimumVersionTimestamp()
The earliest tuple revision timestamp associated with any tuple spanned
by this node or leaf.
|
long |
getSpannedTupleCount()
The #of tuples spanned by this node.
|
boolean |
hasVersionTimestamps()
Return
true iff the leaves maintain tuple revision
timestamps. |
boolean |
isCoded()
No.
|
boolean |
isLeaf()
True iff this is a leaf node.
|
boolean |
isReadOnly()
No - this is a mutable data record.
|
protected boolean |
rangeCheckChildIndex(int index)
Range check a child index.
|
public MutableNodeData(int branchingFactor, boolean hasVersionTimestamps)
branchingFactor
- The branching factor for the owning B+Tree. This is used to
initialize the various arrays to the correct capacity.hasVersionTimestamps
- true
iff the B+Tree is maintaining per tuple
version timestamps.public MutableNodeData(int branchingFactor, INodeData src)
branchingFactor
- The branching factor for the owning B+Tree. This is used to
initialize the various arrays to the correct capacity.src
- The source data record.public MutableNodeData(long nentries, IRaba keys, long[] childAddr, long[] childEntryCounts, boolean hasVersionTimestamps, long minimumVersionTimestamp, long maximumVersionTimestamp)
nentries
- keys
- childAddr
- childEntryCounts
- public final boolean isReadOnly()
isReadOnly
in interface IAbstractNodeData
public final boolean isCoded()
isCoded
in interface IAbstractNodeData
public final AbstractFixedByteArrayBuffer data()
IAbstractNodeData
data
in interface IAbstractNodeData
data
in interface IDataRecordAccess
public final long getSpannedTupleCount()
ISpannedTupleCountData
IKeysData.getKeyCount()
or
ILeafData.getValueCount()
.getSpannedTupleCount
in interface ISpannedTupleCountData
protected final boolean rangeCheckChildIndex(int index)
index
- The index of a child in [0:nkeys+1].true
IndexOutOfBoundsException
- if the index is not in the legal range.public final long getChildAddr(int index)
IChildData
getChildAddr
in interface IChildData
index
- The index of the child in [0:nkeys].public final long getChildEntryCount(int index)
ISpannedTupleCountData
ISpannedTupleCountData.getSpannedTupleCount()
. These data are used to support fast computation of the index at which a
key occurs and the #of entries in a given key range.getChildEntryCount
in interface ISpannedTupleCountData
index
- The index of the child in [0:nkeys].public final int getChildCount()
IChildData
IAbstractNodeData#getKeyCount()
+1
getChildCount
in interface IChildData
public final int getKeyCount()
IKeysData
nkeys+1
children. A leaf has nkeys
keys and values. The maximum #of
keys for a node is one less than the branching factor of the B+Tree. The
maximum #of keys for a leaf is the branching factor of the B+Tree. For a
hash bucket, this is the #of entries in the bucket.getKeyCount
in interface IKeysData
public final IRaba getKeys()
IKeysData
public final boolean isLeaf()
IAbstractNodeData
isLeaf
in interface IAbstractNodeData
public final boolean hasVersionTimestamps()
IAbstractNodeData
true
iff the leaves maintain tuple revision
timestamps. When true
, the minimum and maximum tuple
revision timestamp for a node or leaf are available from
IAbstractNodeData.getMinimumVersionTimestamp()
and
IAbstractNodeData.getMaximumVersionTimestamp()
.hasVersionTimestamps
in interface IAbstractNodeData
public final long getMaximumVersionTimestamp()
IAbstractNodeData
Long.MIN_VALUE
since the initial value of the
maximum version timestamp is always the smallest possible long integer.getMaximumVersionTimestamp
in interface IAbstractNodeData
public final long getMinimumVersionTimestamp()
IAbstractNodeData
Long.MAX_VALUE
since the initial value of the minimum
version timestamp is always the largest possible long integer.getMinimumVersionTimestamp
in interface IAbstractNodeData
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.