public class PartitionedTupleIterator<E> extends Object implements ITupleIterator<E>
DataServiceTupleIterator
query. In
turn, the DataServiceTupleIterator
may make several queries to the
data service per partition. The actual #of queries made to the data service
depends on the #of index entries that are visited per partition and the
capacity specified to the ctor. StaleLocatorException
s are handled
transparently by restarting the locator scan and continuing the range query
request from the successor (or predecessor for a reverse scan) of the last
key visited. When the operation is unisolated, this class will correctly
complete the range iterator request even if the index partition is split,
joined or moved during traversal.Constructor and Description |
---|
PartitionedTupleIterator(IScaleOutClientIndex ndx,
long ts,
boolean isReadConsistentTx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
Note: The
PartitionedTupleIterator uses a sequential scan (rather
than mapping across the index partitions in parallel) and always picks up
from the successor of the last key visited. |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
int |
getPartitionCount()
Deprecated.
The #of partitions is a bit tricky since splits and joins can
introduce new partitions unless you are using a
read-consistent view.
|
long |
getVisitedCount()
The #of entries visited so far (not the #of entries scanned, which
can be much greater if a filter is in use).
|
boolean |
hasNext() |
ITuple<E> |
next()
Advance the iterator and return the
ITuple from which you can
extract the data and metadata for next entry. |
void |
remove()
Batch delete behind semantics.
|
String |
toString() |
public PartitionedTupleIterator(IScaleOutClientIndex ndx, long ts, boolean isReadConsistentTx, byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
Note: The PartitionedTupleIterator
uses a sequential scan (rather
than mapping across the index partitions in parallel) and always picks up
from the successor of the last key visited. Read-consistent is achieved
by specifying a commitTime for the timestamp rather than
ITx.READ_COMMITTED
. The latter will use dirty reads (each time a
ResultSet
is fetched it will be fetched from the most recently
committed state of the database).
ndx
- ts
- The timestamp for the view (may be a transaction).isReadConsistentTx
- true
iff the caller specified timestamp is a
read-historical transaction created specifically to give the
iterator read-consistent semantics. when true
,
this class will ensure that the transaction is eventually
aborted so that its read lock will be released. This is done
eagerly when the iterator is exhausted and with a
finalize()
method otherwise.fromKey
- toKey
- capacity
- flags
- filter
- IllegalArgumentException
- if readConsistent is requested and the index view is
ITx.UNISOLATED
.public int getPartitionCount()
public long getVisitedCount()
public ITuple<E> next()
ITupleIterator
ITuple
from which you can
extract the data and metadata for next entry.
Note: An ITupleIterator
s will generally return the same
ITuple
reference on on each invocation of this method. The caller
is responsible for copying out any data or metadata of interest before
calling ITupleIterator.next()
again. See TupleFilter
which is aware of
this and can be used to stack filters safely.
public void remove()
remove
in interface Iterator<ITuple<E>>
AbstractChunkedTupleIterator.remove()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.