public class MockLeafData extends Object implements ILeafData
ILeafData used for unit tests.| Constructor and Description |
|---|
MockLeafData(IRaba keys,
IRaba vals,
boolean[] deleteMarkers,
long[] versionTimestamps,
boolean[] rawRecords) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyKey(int index,
OutputStream os) |
AbstractFixedByteArrayBuffer |
data()
The coded (aka compressed) data.
|
boolean |
getDeleteMarker(int index)
Return
true iff the entry at the specified index is marked
as deleted. |
byte[] |
getKey(int index) |
int |
getKeyCount() |
IRaba |
getKeys() |
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 |
getNextAddr()
The address of the next leaf in key order,
0L if it is known
that there is no next leaf, and -1L if either: (a) it is not
known whether there is a next leaf; or (b) it is known but the address of
that leaf is not known to the caller. |
long |
getPriorAddr()
The address of the previous leaf in key order,
0L if it is
known that there is no previous leaf, and -1L if either: (a)
it is not known whether there is a previous leaf; or (b) it is known but
the address of that leaf is not known to the caller. |
long |
getRawRecord(int index)
Return the address of the raw record on the backing store of the value
stored in the tuple having the given index -or-
IAddressManager.NULL if
the value is the actual byte[] value associated with the key
in the leaf. |
byte[] |
getValue(int index) |
int |
getValueCount()
The #of values in the leaf (this MUST be equal to the #of keys for a
leaf).
|
IRaba |
getValues()
Return the object storing the logical byte[][] containing the values for
the leaf.
|
long |
getVersionTimestamp(int index)
The version timestamp for the entry at the specified index.
|
boolean |
hasDeleteMarkers()
Return
true iff the leaf maintains delete markers. |
boolean |
hasRawRecords()
Return
true iff the leaf promotes large byte[]
values to raw records on the backing store. |
boolean |
hasVersionTimestamps()
Return
true iff the leaf maintains version timestamps. |
boolean |
isCoded()
No.
|
boolean |
isDoubleLinked()
Return
true if the leaf data record supports encoding of the
address of the previous and next leaf in the B+Tree order. |
boolean |
isLeaf()
True iff this is a leaf node.
|
boolean |
isReadOnly()
True iff this is an immutable data structure.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetKeyCount, getKeyspublic final IRaba getValues()
ILeafData
Note: When the leaf maintains raw records you MUST check whether or not
the value was written onto a raw record before interpreting the data
returned by IRaba.get(int). If the length of the value exceeded
the configured maximum record length for the index, then the value was
written onto a raw record on the backing store and IRaba.get(int)
will return the encoded address of that record rather than its data.
getValues in interface ILeafDataILeafData.hasDeleteMarkers(),
ILeafData.getDeleteMarker(int)public final byte[] getValue(int index)
public final int getValueCount()
ILeafDatagetValueCount in interface ILeafDatapublic final boolean isLeaf()
IAbstractNodeDataisLeaf in interface IAbstractNodeDatapublic final boolean isReadOnly()
IAbstractNodeDataisReadOnly in interface IAbstractNodeDatapublic final boolean isCoded()
isCoded in interface IAbstractNodeDatapublic final AbstractFixedByteArrayBuffer data()
IAbstractNodeDatadata in interface IAbstractNodeDatadata in interface IDataRecordAccesspublic final boolean getDeleteMarker(int index)
ILeafDatatrue iff the entry at the specified index is marked
as deleted.getDeleteMarker in interface ILeafDatapublic final long getVersionTimestamp(int index)
ILeafDatagetVersionTimestamp in interface ILeafDatapublic final long getRawRecord(int index)
ILeafDataIAddressManager.NULL if
the value is the actual byte[] value associated with the key
in the leaf. When the value is the address of a raw record, the actual
byte[] value should be read from the backing store using the
decoded address.
Raw record addresses are created transparently when a large
byte[] is associated with a key in the leaf. They are
materialized transparently when the tuple associated with the leaf is
read. They are deleted when the tuple associated with the leaf is
deleted.
Note: Raw records are managed at the leaf, rather than the IRaba
level, because there is not always a backing store associated with an
IRaba object. This is similar to how deleted tuples are handled.
However, IRabaCoders are responsible for coding the
long address stored in the values raba.
Raw records are only used for large byte[] values. Highly specialized
IRabaCoders can avoid the potential for a conflict with their own
coding scheme by ensuring that the index either will not promote large
values to raw records or by refraining from inserting large values into
the index.
getRawRecord in interface ILeafDataIAddressManager.NULLpublic final boolean hasDeleteMarkers()
ILeafDatatrue iff the leaf maintains delete markers.hasDeleteMarkers in interface ILeafDatapublic final boolean hasVersionTimestamps()
ILeafDatatrue iff the leaf maintains version timestamps.hasVersionTimestamps in interface IAbstractNodeDatahasVersionTimestamps in interface ILeafDatapublic boolean hasRawRecords()
ILeafDatatrue iff the leaf promotes large byte[]
values to raw records on the backing store.hasRawRecords in interface ILeafDatapublic boolean isDoubleLinked()
ILeafDatatrue if the leaf data record supports encoding of the
address of the previous and next leaf in the B+Tree order.isDoubleLinked in interface ILeafDatapublic long getNextAddr()
ILeafData0L if it is known
that there is no next leaf, and -1L if either: (a) it is not
known whether there is a next leaf; or (b) it is known but the address of
that leaf is not known to the caller.getNextAddr in interface ILeafDatapublic long getPriorAddr()
ILeafData0L if it is
known that there is no previous leaf, and -1L if either: (a)
it is not known whether there is a previous leaf; or (b) it is known but
the address of that leaf is not known to the caller.getPriorAddr in interface ILeafDatapublic long getMaximumVersionTimestamp()
IAbstractNodeDataLong.MIN_VALUE since the initial value of the
maximum version timestamp is always the smallest possible long integer.getMaximumVersionTimestamp in interface IAbstractNodeDatapublic long getMinimumVersionTimestamp()
IAbstractNodeDataLong.MAX_VALUE since the initial value of the minimum
version timestamp is always the largest possible long integer.getMinimumVersionTimestamp in interface IAbstractNodeDatapublic final int getKeyCount()
public final IRaba getKeys()
public final byte[] getKey(int index)
public final void copyKey(int index,
OutputStream os)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.