public class RawDataServiceTupleIterator<E> extends AbstractChunkedTupleIterator<E>
IDataService
but DOES NOT handle index partition splits, moves or
joins.
Note: This class supports caching of the remote metadata index, which does
not use index partitions, by the AbstractDistributedFederation
.
AbstractChunkedTupleIterator.ResultSetTuple
Modifier and Type | Field and Description |
---|---|
protected IDataService |
dataService
The data service for the index.
|
static String |
ERR_NO_KEYS
Error message used by
#getKey() when the iterator was not
provisioned to request keys from the data service. |
static String |
ERR_NO_VALS
Error message used by
#getValue() when the iterator was not
provisioned to request values from the data service. |
String |
name
The name of the index partition on which the range query is being
performed.
|
capacity, DEBUG, exhausted, filter, flags, fromKey, INFO, lastVisited, lastVisitedKeyInPriorResultSet, log, nqueries, nvisited, rset, toKey
Constructor and Description |
---|
RawDataServiceTupleIterator(IDataService dataService,
String name,
long timestamp,
boolean readConsistent,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter) |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteBehind(int n,
Iterator<byte[]> itr)
Batch delete the index entries identified by keys and clear the
list.
|
protected void |
deleteLast(byte[] key)
Delete the index entry identified by key.
|
protected boolean |
getReadConsistent()
When
true the AbstractChunkedTupleIterator.getCommitTime() will be used to
ensure that AbstractChunkedTupleIterator.continuationQuery() s run against the same commit
point for the local index partition thereby producing a read
consistent view even when the iterator is ITx.READ_COMMITTED . |
protected ResultSet |
getResultSet(long timestamp,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
Atomic operation caches a chunk of results from an
IDataService . |
protected long |
getTimestamp()
The timestamp for the operation as specified by the ctor (this is used
for remote index queries but when running against a local index).
|
protected IBlock |
readBlock(int sourceIndex,
long addr)
Return an object that may be used to read the block from the backing
store per the contract for
ITuple.readBlock(long) |
continuationQuery, deleteBehind, flush, getCommitTime, getDefaultCapacity, getQueryCount, getReadTime, getVisitedCount, hasNext, next, rangeQuery, remove
public static final transient String ERR_NO_KEYS
#getKey()
when the iterator was not
provisioned to request keys from the data service.public static final transient String ERR_NO_VALS
#getValue()
when the iterator was not
provisioned to request values from the data service.protected final IDataService dataService
Note: Be careful when using this field since you take on responsibilty for handling index partition splits, joins, and moves!
public final String name
public RawDataServiceTupleIterator(IDataService dataService, String name, long timestamp, boolean readConsistent, byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
dataService
- The data service on which the index resides.name
- The name of the index partition on that data service.timestamp
- The timestamp used for the reads.readConsistent
- This option is only available for ITx.READ_COMMITTED
.
When true
, the first read will be against the
most recent commit point on the database and any continuation
queries will be against the same commit point. When
false
, each read will be against the most
recent commit point (so the data can be drawn from multiple
commit points if there are concurrent commits).
The readConsistent option is a tweak available only at
this low level for the RawDataServiceTupleIterator
.
It avoids a possible RMI to obtain the most recent global
commit point using IIndexStore.getLastCommitTime()
in
favor of using the most recent commit point on the index
partition at the time that the query is actually executed. If
you are reading against a scale-out index, then similar
effects are obtained by choosing either
ITx.READ_COMMITTED
or
IIndexStore.getLastCommitTime()
. See
ClientIndexView
and
PartitionedTupleIterator
.
fromKey
- toKey
- capacity
- flags
- filter
- protected ResultSet getResultSet(long timestamp, byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
IDataService
.
Note: This uses the timestamp specified by the caller NOT the
timestamp
value stored by this class. This allows us to have
read-consistent semantics if desired for ITx.UNISOLATED
or
ITx.READ_COMMITTED
operations.
getResultSet
in class AbstractChunkedTupleIterator<E>
protected void deleteBehind(int n, Iterator<byte[]> itr)
AbstractChunkedTupleIterator
deleteBehind
in class AbstractChunkedTupleIterator<E>
n
- The #of keys to be deleted.itr
- The keys to be deleted.protected void deleteLast(byte[] key)
AbstractChunkedTupleIterator
deleteLast
in class AbstractChunkedTupleIterator<E>
key
- A key.protected IBlock readBlock(int sourceIndex, long addr)
AbstractChunkedTupleIterator
ITuple.readBlock(long)
readBlock
in class AbstractChunkedTupleIterator<E>
sourceIndex
- The value from ITuple.getSourceIndex()
.addr
- The value supplied to ITuple.readBlock(long)
.protected final long getTimestamp()
AbstractChunkedTupleIterator
getTimestamp
in class AbstractChunkedTupleIterator<E>
protected final boolean getReadConsistent()
AbstractChunkedTupleIterator
true
the AbstractChunkedTupleIterator.getCommitTime()
will be used to
ensure that AbstractChunkedTupleIterator.continuationQuery()
s run against the same commit
point for the local index partition thereby producing a read
consistent view even when the iterator is ITx.READ_COMMITTED
.
When false
AbstractChunkedTupleIterator.continuationQuery()
s will use
whatever value is returned by AbstractChunkedTupleIterator.getTimestamp()
. Read-consistent
semantics for a partitioned index are achieved using the timestamp
returned by IIndexStore.getLastCommitTime()
rather than
ITx.READ_COMMITTED
.getReadConsistent
in class AbstractChunkedTupleIterator<E>
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.