|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.ndx.PartitionedTupleIterator<E>
public class PartitionedTupleIterator<E>
Class supports range query across one or more index partitions. Each
partition is mapped onto a single 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. StaleLocatorExceptions 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.
| Field Summary | |
|---|---|
protected static boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
PartitionedTupleIterator(IScaleOutClientIndex ndx,
long ts,
boolean isReadConsistentTx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilterConstructor 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. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final transient org.apache.log4j.Logger log
protected static final boolean INFO
| Constructor Detail |
|---|
public PartitionedTupleIterator(IScaleOutClientIndex ndx,
long ts,
boolean isReadConsistentTx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilterConstructor 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.| Method Detail |
|---|
public int getPartitionCount()
public long getVisitedCount()
protected void finalize()
finalize in class Objectpublic boolean hasNext()
hasNext in interface Iterator<ITuple<E>>public ITuple<E> next()
ITupleIteratorITuple from which you can
extract the data and metadata for next entry.
Note: An ITupleIterators 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.
next in interface ITupleIterator<E>next in interface Iterator<ITuple<E>>ITuple containing the data and metadata for the
current index entry.public void remove()
remove in interface Iterator<ITuple<E>>AbstractChunkedTupleIterator.remove()public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||