com.bigdata.btree
Class IndexSegmentBuilder.SimpleNodeData

java.lang.Object
  extended by com.bigdata.btree.IndexSegmentBuilder.AbstractSimpleNodeData
      extended by com.bigdata.btree.IndexSegmentBuilder.SimpleNodeData
All Implemented Interfaces:
IAbstractNodeData, IChildData, IKeysData, INodeData, ISpannedTupleCountData, ITreeNodeData, IDataRecordAccess
Enclosing class:
IndexSegmentBuilder

protected static class IndexSegmentBuilder.SimpleNodeData
extends IndexSegmentBuilder.AbstractSimpleNodeData
implements INodeData

A class that can be used to (de-)serialize the data for a node without any of the logic for operations on the node.

Note: All node addresses that are internal to a node and reference a child node (vs a leaf) are correct relative to the start of the IndexSegmentRegion.NODE region. This is an unavoidable consequence of serializing the nodes before we have the total offset to the start of the IndexSegmentRegion.NODE region.

Author:
Bryan Thompson
See Also:
IndexSegmentRegion, IndexSegmentAddressManager

Constructor Summary
IndexSegmentBuilder.SimpleNodeData(int level, int m, boolean hasVersionTimestamps)
           
 
Method Summary
 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.
 long getSpannedTupleCount()
          The #of tuples spanned by this node.
 boolean hasVersionTimestamps()
          Return true iff the leaves maintain tuple revision timestamps.
 boolean isLeaf()
          True iff this is a leaf node.
protected  void reset(int max)
          Reset counters and flags so that the node may be reused.
 
Methods inherited from class com.bigdata.btree.IndexSegmentBuilder.AbstractSimpleNodeData
data, getKeyCount, getKeys, getMaximumVersionTimestamp, getMinimumVersionTimestamp, isCoded, isReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bigdata.btree.data.IAbstractNodeData
data, getMaximumVersionTimestamp, getMinimumVersionTimestamp, isCoded, isReadOnly
 
Methods inherited from interface com.bigdata.btree.data.IKeysData
getKeyCount, getKeys
 

Constructor Detail

IndexSegmentBuilder.SimpleNodeData

public IndexSegmentBuilder.SimpleNodeData(int level,
                                          int m,
                                          boolean hasVersionTimestamps)
Method Detail

getSpannedTupleCount

public final long getSpannedTupleCount()
Description copied from interface: ISpannedTupleCountData
The #of tuples spanned by this node. For a leaf, the corresponding value is reported by IKeysData.getKeyCount() or ILeafData.getValueCount().

Specified by:
getSpannedTupleCount in interface ISpannedTupleCountData

getChildAddr

public final long getChildAddr(int index)
Description copied from interface: IChildData
Return the persistent addresses of the specified child node.

Specified by:
getChildAddr in interface IChildData
Parameters:
index - The index of the child in [0:nkeys].
Returns:
The persistent child address -or- zero(0L) if the child is not persistent.

getChildEntryCount

public final long getChildEntryCount(int index)
Description copied from interface: ISpannedTupleCountData
Return the #of tuples spanned by the indicated child of this node. The sum of the values returned by this method across the children of the node should always equal the value returned by 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.

Specified by:
getChildEntryCount in interface ISpannedTupleCountData
Parameters:
index - The index of the child in [0:nkeys].
Returns:
The #of tuples spanned by that child.

reset

protected void reset(int max)
Reset counters and flags so that the node may be reused.

Overrides:
reset in class IndexSegmentBuilder.AbstractSimpleNodeData
Parameters:
max - The new limit on the #of children to fill on this node.

getChildCount

public final int getChildCount()
Description copied from interface: IChildData
The #of children of this node. Either all children will be nodes or all children will be leaves. The #of children of a node MUST be IAbstractNodeData#getKeyCount()+1

Specified by:
getChildCount in interface IChildData
Returns:
The #of children of this node.

isLeaf

public final boolean isLeaf()
Description copied from interface: IAbstractNodeData
True iff this is a leaf node.

Specified by:
isLeaf in interface IAbstractNodeData

hasVersionTimestamps

public final boolean hasVersionTimestamps()
Description copied from interface: IAbstractNodeData
Return 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().

Specified by:
hasVersionTimestamps in interface IAbstractNodeData


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.