| Modifier and Type | Field and Description |
|---|---|
protected int |
flags |
protected boolean |
needKeys |
protected boolean |
needVals |
| Constructor and Description |
|---|
AbstractTuple(int flags) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clear()
Clears the buffered data copied into the
AbstractTuple from the
source btree. |
void |
copy(int index,
ILeafData leaf)
|
void |
copyTuple(byte[] key,
byte[] val)
Assumes that the tuple is not deleted and that timestamp information is
not available.
|
void |
copyTuple(byte[] key,
byte[] val,
boolean deleted,
long timestamp)
Sets all fields on the tuple and increments the tuple visited counter.
|
void |
copyTuple(ITuple t)
Sets all fields and increments the tuple visited counter.
|
int |
flags()
The
IRangeQuery flags |
static String |
flagString(int flags)
Externalizes the flags as a list of symbolic constants.
|
byte[] |
getKey()
Returns a copy of the current key.
|
ByteArrayBuffer |
getKeyBuffer()
The buffer into which the keys are being copied.
|
boolean |
getKeysRequested()
True iff
IRangeQuery.KEYS was specified. |
DataInputBuffer |
getKeyStream()
Return a stream from which the key may be read.
|
E |
getObject()
De-serializes the object from the key and/or value.
|
byte[] |
getValue()
The value in the index under the key.
|
ByteArrayBuffer |
getValueBuffer()
The buffer into which the values are being copied.
|
boolean |
getValuesRequested()
True iff
IRangeQuery.VALS was specified. |
DataInputBuffer |
getValueStream()
Return a stream from which the value may be read.
|
long |
getVersionTimestamp()
Return the timestamp associated with the index entry -or-
0L
IFF the index does not support transactional isolation. |
long |
getVisitCount()
The #of entries that have been visited so far and ZERO (0) until the
first entry has been visited.
|
boolean |
isDeletedVersion()
Return
true iff the index entry was marked as deleted. |
boolean |
isNull()
true iff the value stored under the index entry is
null. |
IBlock |
readBlock(long addr)
Return an object that may be used to perform a streaming read of a large
record from the
IRawStore that provided this tuple. |
String |
toString()
Note: A de-serialization problem thrown out of
toString() MAY
indicate that the ITupleSerializer was not overriden and a raw
byte[] was stored as the tuple's value. |
static String |
toString(ITuple tuple)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSourceIndex, getTupleSerializerprotected final int flags
protected final boolean needKeys
protected final boolean needVals
public final int flags()
ITupleIRangeQuery flags
if ((flags & IRangeQuery.KEYS) != 0) {
// keys requested.
}
Note: the IRangeQuery.DELETED flag state is a property of the
iterator NOT the tuple. Whether or not a tuple is deleted is detected
using ITuple.isDeletedVersion().public final boolean getKeysRequested()
ITupleIRangeQuery.KEYS was specified.getKeysRequested in interface ITuple<E>public final boolean getValuesRequested()
ITupleIRangeQuery.VALS was specified.getValuesRequested in interface ITuple<E>public final ByteArrayBuffer getKeyBuffer()
ITuplegetKeyBuffer in interface ITuple<E>public final DataInputBuffer getKeyStream()
getKeyStream in interface ITuple<E>UnsupportedOperationException - if the keys were not requested.public final DataInputBuffer getValueStream()
getValueStream in interface ITuple<E>UnsupportedOperationException - if the values were not requested.public long getVisitCount()
getVisitCount in interface ITuple<E>public final byte[] getKey()
ITuple
Note: This can cause a heap allocation depending on how the keys are
buffered. See ITuple.getKeyBuffer() to avoid that allocation.
public final boolean isNull()
ITupletrue iff the value stored under the index entry is
null.public final byte[] getValue()
ITuple
Note: This causes a heap allocation. See ITuple.getValueBuffer() to
avoid that allocation.
public final ByteArrayBuffer getValueBuffer()
ITuple
Note: If the index supports delete markers then you MUST test
ITuple.isDeletedVersion() in order to determine whether or not the
value buffer contains data for the current index entry.
getValueBuffer in interface ITuple<E>public final E getObject()
ITuplegetObject in interface ITuple<E>ITupleSerializer.deserialize(ITuple)public final long getVersionTimestamp()
ITuple0L
IFF the index does not support transactional isolation.getVersionTimestamp in interface ITuple<E>public final boolean isDeletedVersion()
ITupletrue iff the index entry was marked as deleted.
Note: If the index does not support deletion markers then this method
MUST return false.
Note: the IRangeQuery.DELETED flag state is a property of the
iterator NOT the tuple. Whether or not a tuple is deleted is detected
using ITuple.isDeletedVersion().
isDeletedVersion in interface ITuple<E>public IBlock readBlock(long addr)
ITupleIRawStore that provided this tuple.public void copy(int index,
ILeafData leaf)
Leaf into the
Tuple and increment the counter of the #of visited entries.index - The index entry.leaf - The leaf. If a raw record must be materialized, it will be
read from the backing store for the Leaf.public void copyTuple(byte[] key,
byte[] val)
key - val - public void copyTuple(byte[] key,
byte[] val,
boolean deleted,
long timestamp)
key - val - deleted - timestamp - public void copyTuple(ITuple t)
t - Some tuple.protected void clear()
AbstractTuple from the
source btree.public String toString()
toString() MAY
indicate that the ITupleSerializer was not overriden and a raw
byte[] was stored as the tuple's value. In this case,
getObject() will attempt to use Java standard de-serialization
on the byte[] value, which will, of course, fail. The fix for this
problem is to specify the NOPTupleSerializer for the index. This
problem may still show up in some of the test suites when the trace level
is turned up since many of the tests were written before the
ITupleSerializer abstraction was addeded.public static String flagString(int flags)
flags - The IRangeQuery flags.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.