public class ChunkedLocalRangeIterator<E> extends AbstractChunkedTupleIterator<E>
Note: When IRangeQuery.REMOVEALL is specified without the
IRangeQuery.CURSOR flag, the iterator will populate its buffers up to
the capacity and then delete behind once the buffer is full or as soon as the
iterator is exhausted. This approach works with the somewhat faster
ITupleIterator construct. When the IRangeQuery.CURSOR flag is
specified, we directly use the ITupleCursor interface.
AbstractChunkedTupleIterator.ResultSetTuple| Modifier and Type | Field and Description |
|---|---|
protected IIndex |
ndx
The backing
IIndex. |
capacity, DEBUG, ERR_NO_KEYS, ERR_NO_VALS, exhausted, filter, flags, fromKey, INFO, lastVisited, lastVisitedKeyInPriorResultSet, log, nqueries, nvisited, rset, toKey| Constructor and Description |
|---|
ChunkedLocalRangeIterator(IIndex ndx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deleteBehind(int n,
Iterator<byte[]> keys)
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 |
getReadConsistent()
Returns
true since the read will be consistent (it reads
against the same index object for each ResultSet) but the values
returned by getTimestamp() and AbstractChunkedTupleIterator.getReadTime() are
ignored by
#getResultSet(long, byte[], byte[], int, int, ITupleFilter)
(since it is reading against a local index object). |
protected ResultSet |
getResultSet(long timestamp,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
Note: timestamp is ignored since we are reading against a local
index object.
|
protected long |
getTimestamp()
Always returns 0L.
|
ITuple<E> |
next()
Visits the next tuple, queuing it for removal unless
IRangeQuery.CURSOR was specified, in which case it is deleted
immediately. |
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, rangeQuery, removeprotected ResultSet getResultSet(long timestamp, byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
getResultSet in class AbstractChunkedTupleIterator<E>public ITuple<E> next()
IRangeQuery.CURSOR was specified, in which case it is deleted
immediately.
Note: Queuing for removal is done only for the local index so that data
service range iterators will do their deletes on the local index when
this range iterator runs rather than buffering the keys and then sending
back a batch delete to the index later (this would also make
IRangeQuery.REMOVEALL non-atomic).
protected void deleteBehind(int n,
Iterator<byte[]> keys)
AbstractChunkedTupleIteratordeleteBehind in class AbstractChunkedTupleIterator<E>n - The #of keys to be deleted.keys - The keys to be deleted.protected void deleteLast(byte[] key)
AbstractChunkedTupleIteratordeleteLast in class AbstractChunkedTupleIterator<E>key - A key.protected IBlock readBlock(int sourceIndex, long addr)
AbstractChunkedTupleIteratorITuple.readBlock(long)readBlock in class AbstractChunkedTupleIterator<E>sourceIndex - The value from ITuple.getSourceIndex().addr - The value supplied to ITuple.readBlock(long).protected long getTimestamp()
#getResultSet(long, byte[], byte[], int, int, ITupleFilter).getTimestamp in class AbstractChunkedTupleIterator<E>public boolean getReadConsistent()
true since the read will be consistent (it reads
against the same index object for each ResultSet) but the values
returned by getTimestamp() and AbstractChunkedTupleIterator.getReadTime() are
ignored by
#getResultSet(long, byte[], byte[], int, int, ITupleFilter)
(since it is reading against a local index object).getReadConsistent in class AbstractChunkedTupleIterator<E>Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.