E
- The generic type for the [E]lements visited by the
Iterator
.public interface IChunkedIterator<E> extends ICloseableIterator<E>
Iterator.next()
. The size of the chunk is up to the implementation.
Note: Chunked iterators are designed to make it easier to write methods that
use the batch APIs but do not require the data that will be visited by the
iterator to be fully materialized. You can use nextChunk()
instead
of Iterator.next()
to break down the operation into N chunks, where N
is determined dynamically based on how much data the iterator returns in each
chunk and how much data there is to be read.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHUNK_SIZE
The default chunk size.
|
Modifier and Type | Method and Description |
---|---|
E |
next()
The next element available from the iterator.
|
E[] |
nextChunk()
Return the next "chunk" from the iterator.
|
void |
remove()
Removes the last element visited by
next() (optional operation). |
close
static final int DEFAULT_CHUNK_SIZE
E next()
next
in interface Iterator<E>
NoSuchElementException
- if the iterator is exhausted.E[] nextChunk()
NoSuchElementException
- if the iterator is exhausted.void remove()
next()
(optional operation).
Note: This method is not readily suited for use with nextChunk()
since the latter has already visited everything in the chunk and
remove()
would only remove the last item in the chunk. Normally
you will want to accumulate items to be removed in a buffer and then
submit the buffer to some batch api operation when it overflows.
Alternatively, the IRangeQuery.REMOVEALL
flag may be used with
the source iterator to remove elements from the index as they are
visited.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.