|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.AbstractChunkedTupleIterator<E>
com.bigdata.btree.ChunkedLocalRangeIterator<E>
public class ChunkedLocalRangeIterator<E>
Chunked range iterator running against a local index or index view.
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.
| Field Summary | |
|---|---|
protected IIndex |
ndx
The backing IIndex. |
| Fields inherited from class com.bigdata.btree.AbstractChunkedTupleIterator |
|---|
capacity, DEBUG, ERR_NO_KEYS, ERR_NO_VALS, exhausted, filter, flags, fromKey, INFO, lastVisited, lastVisitedKeyInPriorResultSet, log, nqueries, nvisited, rset, toKey |
| Constructor Summary | |
|---|---|
ChunkedLocalRangeIterator(IIndex ndx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilterConstructor filter)
|
|
| Method Summary | |
|---|---|
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,
IFilterConstructor 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) |
| Methods inherited from class com.bigdata.btree.AbstractChunkedTupleIterator |
|---|
continuationQuery, deleteBehind, flush, getCommitTime, getDefaultCapacity, getQueryCount, getReadTime, getVisitedCount, hasNext, rangeQuery, remove |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final IIndex ndx
IIndex.
| Constructor Detail |
|---|
public ChunkedLocalRangeIterator(IIndex ndx,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilterConstructor filter)
fromKey - toKey - capacity - flags - filter - | Method Detail |
|---|
protected ResultSet getResultSet(long timestamp,
byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilterConstructor 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).
next in interface ITupleIterator<E>next in interface Iterator<ITuple<E>>next in class AbstractChunkedTupleIterator<E>ITuple containing the data and metadata for the
current index entry.
protected void deleteBehind(int n,
Iterator<byte[]> keys)
AbstractChunkedTupleIterator
deleteBehind in class AbstractChunkedTupleIterator<E>n - The #of keys to be deleted.keys - 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)
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>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||