public class DataServiceTupleIterator<E> extends RawDataServiceTupleIterator<E>
IDataService
.AbstractChunkedTupleIterator.ResultSetTuple
Modifier and Type | Field and Description |
---|---|
protected IScaleOutClientIndex |
ndx
Used to submit delete requests to the scale-out index in a robust
manner.
|
dataService, ERR_NO_KEYS, ERR_NO_VALS, name
capacity, DEBUG, exhausted, filter, flags, fromKey, INFO, lastVisited, lastVisitedKeyInPriorResultSet, log, nqueries, nvisited, rset, toKey
Constructor and Description |
---|
DataServiceTupleIterator(IScaleOutClientIndex ndx,
IDataService dataService,
String name,
long timestamp,
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.
|
boolean |
hasNext()
This method (and no other method on this class) will throw a (possibly
wrapped)
StaleLocatorException if an index partition is split,
joined or moved during traversal. |
getReadConsistent, getResultSet, getTimestamp, readBlock
continuationQuery, deleteBehind, flush, getCommitTime, getDefaultCapacity, getQueryCount, getReadTime, getVisitedCount, next, rangeQuery, remove
protected final IScaleOutClientIndex ndx
public DataServiceTupleIterator(IScaleOutClientIndex ndx, IDataService dataService, String name, long timestamp, byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
ndx
- The scale-out index view.dataService
- The data service to be queried.name
- The name of an index partition of that scale-out index on the
data service.timestamp
- The timestamp used for the reads. If
ITx.READ_COMMITTED
, then each read will be against
the most recent commit point on the database. If you want
read-consistent, then use
IIndexStore.getLastCommitTime()
rather than
ITx.READ_COMMITTED
.fromKey
- toKey
- capacity
- flags
- filter
- public boolean hasNext()
StaleLocatorException
if an index partition is split,
joined or moved during traversal.
The caller MUST test any thrown exception. If the exception is, or wraps,
a StaleLocatorException
, then the caller MUST refresh its
locator
for the key range of the index
partition that it thought it was traversing, and then continue traversal
based on the revised locators(s).
Note: The StaleLocatorException
CAN NOT arise from any other
method since only
#getResultSet(byte[], byte[], int, int, IFilter)
actually reads from the IDataService
and ALL calls to that method
are driven by hasNext()
.
Note: The methods that handle delete-behind use the
ClientIndexView
to be robust and therefore will never throw a
StaleLocatorException
.
protected void deleteBehind(int n, Iterator<byte[]> itr)
AbstractChunkedTupleIterator
deleteBehind
in class RawDataServiceTupleIterator<E>
n
- The #of keys to be deleted.itr
- The keys to be deleted.protected void deleteLast(byte[] key)
AbstractChunkedTupleIterator
deleteLast
in class RawDataServiceTupleIterator<E>
key
- A key.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.