/** * Wraps the source iterator as a chunked iterator. * * @param chunkSize * The chunk size. * @param src * The source iterator. */ @SuppressWarnings("unchecked") public ChunkedStriterator(final int chunkSize, final Iterator<E> src) { this((I) new ChunkedWrappedIterator<E>(src, chunkSize, null/* keyOrder */, null/* filter */)); }
/** * Wraps the source iterator as a chunked iterator. * * @param chunkSize * The chunk size. * @param src * The source iterator. */ @SuppressWarnings("unchecked") public ChunkedStriterator(final int chunkSize, final Iterator<E> src) { this((I) new ChunkedWrappedIterator<E>(src, chunkSize, null/* keyOrder */, null/* filter */)); }
/** * Wraps the source iterator as a chunked ordered iterator. * * @param chunkSize * The chunk size. * @param src * The source iterator. */ @SuppressWarnings("unchecked") public ChunkedOrderedStriterator(final int chunkSize, final Iterator<E> src) { this((I) new ChunkedWrappedIterator<E>(src, chunkSize, null/* keyOrder */, null/*filter*/)); }
/** * Wraps the source iterator as a chunked ordered iterator. * * @param chunkSize * The chunk size. * @param src * The source iterator. */ @SuppressWarnings("unchecked") public ChunkedOrderedStriterator(final int chunkSize, final Iterator<E> src) { this((I) new ChunkedWrappedIterator<E>(src, chunkSize, null/* keyOrder */, null/*filter*/)); }
public Chunkerator(final Iterator<E> src, final int chunkSize, final Class<? extends E> elementClass, final IKeyOrder<E> keyOrder, final IElementFilter<E> filter) { if (src == null) throw new IllegalArgumentException(); this.src = new ChunkedWrappedIterator<E>(src, chunkSize, elementClass, keyOrder, filter); }
public Chunkerator(final Iterator<E> src, final int chunkSize, final Class<? extends E> elementClass, final IKeyOrder<E> keyOrder, final IElementFilter<E> filter) { if (src == null) throw new IllegalArgumentException(); this.src = new ChunkedWrappedIterator<E>(src, chunkSize, elementClass, keyOrder, filter); }
/** * Visits nothing. */ @Override @SuppressWarnings("unchecked") public IChunkedOrderedIterator<E> iterator(final long offset, final long limit, final int capacity) { return new ChunkedWrappedIterator<E>(Collections.EMPTY_LIST.iterator()); }
/** * Visits nothing. */ @Override @SuppressWarnings("unchecked") public IChunkedOrderedIterator<E> iterator(final long offset, final long limit, final int capacity) { return new ChunkedWrappedIterator<E>(Collections.EMPTY_LIST.iterator()); }
public void test_filter() { final IChunkedIterator<Long> actual = (IChunkedIterator<Long>) new ChunkedStriterator<IChunkedIterator<Long>, Long>( Arrays.asList(new Long[] { 1L, 3L, 5L }).iterator()) .addFilter(new Appender<IChunkedIterator<Long>, Long>( new ChunkedWrappedIterator<Long>(Arrays.asList( new Long[] { 2L, 3L, 4L }).iterator()))); assertEquals(new Long[] { // 1L, 3L, 5L, // src1 2L, 3L, 4L, // src2 }, actual.nextChunk()); }
public void test_filter() { final IChunkedIterator<Long> actual = (IChunkedIterator<Long>) new ChunkedStriterator<IChunkedIterator<Long>, Long>( Arrays.asList(new Long[] { 1L, 3L, 5L }).iterator()) .addFilter(new MergeFilter<IChunkedIterator<Long>, Long>( new ChunkedWrappedIterator<Long>(Arrays.asList( new Long[] { 2L, 3L, 4L }).iterator()))); assertEquals(new Long[] { 1L, 2L, 3L, 4L, 5L }, actual.nextChunk()); }
public void test_filter() { final IChunkedIterator<Long> actual = (IChunkedIterator<Long>) new ChunkedStriterator<IChunkedIterator<Long>, Long>( Arrays.asList(new Long[] { 1L, 3L, 5L }).iterator()) .addFilter(new MergeFilter<IChunkedIterator<Long>, Long>( new ChunkedWrappedIterator<Long>(Arrays.asList( new Long[] { 2L, 3L, 4L }).iterator()))); assertEquals(new Long[] { 1L, 2L, 3L, 4L, 5L }, actual.nextChunk()); }
public void test_filter() { final IChunkedIterator<Long> actual = (IChunkedIterator<Long>) new ChunkedStriterator<IChunkedIterator<Long>, Long>( Arrays.asList(new Long[] { 1L, 3L, 5L }).iterator()) .addFilter(new Appender<IChunkedIterator<Long>, Long>( new ChunkedWrappedIterator<Long>(Arrays.asList( new Long[] { 2L, 3L, 4L }).iterator()))); assertEquals(new Long[] { // 1L, 3L, 5L, // src1 2L, 3L, 4L, // src2 }, actual.nextChunk()); }
/** * Return iterator visiting the inferences that were removed from the KB. */ public BigdataStatementIterator removedIterator() { // Wrap as chunked iterator. final IChunkedOrderedIterator<ISPO> src = new ChunkedWrappedIterator<ISPO>( removed.iterator()); // Asynchronous conversion of ISPOs to Statements. return new BigdataStatementIteratorImpl(kb, src).start(kb .getExecutorService()); }
/** * Return iterator visiting the inferences that were removed from the KB. */ public BigdataStatementIterator removedIterator() { // Wrap as chunked iterator. final IChunkedOrderedIterator<ISPO> src = new ChunkedWrappedIterator<ISPO>( removed.iterator()); // Asynchronous conversion of ISPOs to Statements. return new BigdataStatementIteratorImpl(kb, src).start(kb .getExecutorService()); }
/** * Return iterator visiting the inferences that were added to the KB. */ public BigdataStatementIterator addedIterator() { // Wrap as chunked iterator. final IChunkedOrderedIterator<ISPO> src = new ChunkedWrappedIterator<ISPO>( added.iterator()); // Asynchronous conversion of ISPOs to Statements. return new BigdataStatementIteratorImpl(kb, src).start(kb .getExecutorService()); }
/** * Return iterator visiting the inferences that were added to the KB. */ public BigdataStatementIterator addedIterator() { // Wrap as chunked iterator. final IChunkedOrderedIterator<ISPO> src = new ChunkedWrappedIterator<ISPO>( added.iterator()); // Asynchronous conversion of ISPOs to Statements. return new BigdataStatementIteratorImpl(kb, src).start(kb .getExecutorService()); }
return new ChunkedWrappedIterator<ISPO>(sitr);
return new ChunkedWrappedIterator<ISPO>(sitr);
/** * Efficient batched, streaming resolution of triple patterns to statements * spanned by those triple patterns that are present in the data. * <p> * Note: If the input contains triple patterns that have a high cardinality * in the data, then a large number of statements may be returned. * * @param triplePatterns * A collection of triple patterns or fully bound statements. If * this collection contains triple patterns that have a high * cardinality in the data, then a large number of statements may * be returned. * * @return An iterator from which the materialized statements spanned by * those triple patterns may be read. * * @see <a href="http://trac.blazegraph.com/ticket/866" > Efficient batch * remove of a collection of triple patterns </a> */ public BigdataStatementIterator getStatements( final IChunkedOrderedIterator<BigdataTriplePattern> triplePatterns) { return asStatementIterator(new ChunkedWrappedIterator<ISPO>( new BigdataTriplePatternMaterializer(this, triplePatterns) .start(getExecutorService()))); }
/** * Efficient batched, streaming resolution of triple patterns to statements * spanned by those triple patterns that are present in the data. * <p> * Note: If the input contains triple patterns that have a high cardinality * in the data, then a large number of statements may be returned. * * @param triplePatterns * A collection of triple patterns or fully bound statements. If * this collection contains triple patterns that have a high * cardinality in the data, then a large number of statements may * be returned. * * @return An iterator from which the materialized statements spanned by * those triple patterns may be read. * * @see <a href="http://trac.blazegraph.com/ticket/866" > Efficient batch * remove of a collection of triple patterns </a> */ public BigdataStatementIterator getStatements( final IChunkedOrderedIterator<BigdataTriplePattern> triplePatterns) { return asStatementIterator(new ChunkedWrappedIterator<ISPO>( new BigdataTriplePatternMaterializer(this, triplePatterns) .start(getExecutorService()))); }