com.bigdata.striterator
Class ChunkedStriterator<I extends IChunkedIterator<E>,E>
java.lang.Object
com.bigdata.striterator.Striterator<I,E>
com.bigdata.striterator.ChunkedStriterator<I,E>
- All Implemented Interfaces:
- IChunkedIterator<E>, IChunkedStriterator<I,E>, ICloseableIterator<E>, IStriterator<I,E>, Enumeration<E>, Iterator<E>
- Direct Known Subclasses:
- ChunkedOrderedStriterator, GenericChunkedStriterator
public class ChunkedStriterator<I extends IChunkedIterator<E>,E>
- extends Striterator<I,E>
- implements IChunkedStriterator<I,E>
Chunked streaming iterator.
- Version:
- $Id: ChunkedStriterator.java 3672 2010-09-28 23:39:42Z thompsonbry $
- Author:
- Bryan Thompson
- TODO:
- Like the
ITupleIterator, the IChunkedIterators can be
executed on the server and them stream results back to the client. We
really need to introduce custom compression for chunk-at-a-time results
streamed back from the server. If the filters are to be specified on
the client and applied on the server, then an
IFilter will be needed to construct the filter stack
on the server.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChunkedStriterator
public ChunkedStriterator(I src)
ChunkedStriterator
public ChunkedStriterator(Iterator<E> src)
- Wraps the source iterator as a chunked iterator using a default chunk
size.
- Parameters:
src - The source iterator.
ChunkedStriterator
public ChunkedStriterator(int chunkSize,
Iterator<E> src)
- Wraps the source iterator as a chunked iterator.
- Parameters:
chunkSize - The chunk size.src - The source iterator.
nextChunk
public final E[] nextChunk()
- Description copied from interface:
IChunkedIterator
- Return the next "chunk" from the iterator.
- Specified by:
nextChunk in interface IChunkedIterator<E>
- Returns:
- The next chunk.
close
public final void close()
- Description copied from interface:
ICloseableIterator
- Closes the iterator, releasing any associated resources. This method MAY
be invoked safely if the iterator is already closed. Implementations of
this interface MUST invoke
ICloseableIterator.close() if Iterator.hasNext()
method returns false to ensure that the iterator is closed
(and its resources release) as soon as it is exhausted.
Note: Implementations that support Iterator.remove() MUST NOT
eagerly close the iterator when it is exhausted since that would make it
impossible to remove the last visited statement. Instead they MUST wait
for an explicit ICloseableIterator.close() by the application.
- Specified by:
close in interface ICloseableIterator<E>
addFilter
public IChunkedStriterator<I,E> addFilter(IFilter<I,?,E> filter)
- Strengthened return type.
- Specified by:
addFilter in interface IChunkedStriterator<I extends IChunkedIterator<E>,E>- Specified by:
addFilter in interface IStriterator<I extends IChunkedIterator<E>,E>- Overrides:
addFilter in class Striterator<I extends IChunkedIterator<E>,E>
- Parameters:
filter - The filter.
- Returns:
- The filtered iterator.
Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.