@Override public E next() { return src.next(); }
public ISPO[] nextChunk() { if (src != null) { return src.nextChunk(); } final int chunkSize = 10000; ISPO[] s = new ISPO[chunkSize]; int n = 0; while (hasNext() && n < chunkSize) { ISolution<ISPO> solution = solutions.next(); // s[n++] = resolverator.resolve(solution); ISPO spo = solution.get(); spo = new SPO(spo.s(), spo.p(), spo.o()); s[n++] = spo; } // copy so that stmts[] is dense. ISPO[] stmts = new ISPO[n]; System.arraycopy(s, 0, stmts, 0, n); // fill in the explicit/inferred information, sort by SPO key order // since we will use the SPO index to do the value completion stmts = db.bulkCompleteStatements(stmts); // resort into desired order Arrays.sort(stmts, 0, n, this.keyOrder.getComparator()); return stmts; }
@Override public E next() { return src.next(); }
public ISPO next() { return delegate.next(); }
public ISPO next() { return delegate.next(); }
public ISPO next() { if (src != null) { return src.next(); } if (chunk == null || i == chunk.length) { chunk = nextChunk(); i = 0; if (log.isInfoEnabled()) log.info("got a chunk, length = " + chunk.length); } return chunk[i++]; }
public ISPO next() { if (src != null) { return src.next(); } if (chunk == null || i == chunk.length) { chunk = nextChunk(); i = 0; if (log.isInfoEnabled()) log.info("got a chunk, length = " + chunk.length); } return chunk[i++]; }
@Override public E next() { return resolve( src.next() ); }
@Override public E next() { return resolve( src.next() ); }
/** * Consumes up to max elements from the iterator and returns a * {@link String} representation of those elements. This is used to show the * additional elements that would be visited by an iterator when the other * iterator is exhausted. * * @param itr * The iterator. * @param max * The maximum #of elements to visit. * @param db * Used to resolve term identifiers to RDF values. * * @return The string representation of the visited elements. */ private String toString(IChunkedOrderedIterator<ISPO> itr, int max, AbstractTripleStore db) { StringBuilder sb = new StringBuilder(); int n = 0; while (itr.hasNext() && n < max) { if (n > 0) sb.append(", "); sb.append(itr.next().toString(db)); } return "{" + sb.toString() + "}"; }
public ISPO next() { if (sameAs2and3It == null) { if (sameAs2and3 != null) { sameAs2and3It = sameAs2and3.getAccessPath(SPOKeyOrder.SPO).iterator(); } else { sameAs2and3It = new EmptyChunkedIterator<ISPO>(SPOKeyOrder.SPO); } } canRemove = false; ISPO current = null; if (src.hasNext()) { current = src.next(); canRemove = true; } else if (sameAs2and3It.hasNext()) { current = sameAs2and3It.next(); } return current; }
public ISPO next() { if (sameAs2and3It == null) { if (sameAs2and3 != null) { sameAs2and3It = sameAs2and3.getAccessPath(SPOKeyOrder.SPO).iterator(); } else { sameAs2and3It = new EmptyChunkedIterator<ISPO>(SPOKeyOrder.SPO); } } canRemove = false; ISPO current = null; if (src.hasNext()) { current = src.next(); canRemove = true; } else if (sameAs2and3It.hasNext()) { current = sameAs2and3It.next(); } return current; }
/** * Simple delete implementation works fine for a local journal. */ public long delete(final IChunkedOrderedIterator<E> itr) { long n = 0; final IIndex ndx = getIndex(primaryKeyOrder); while (itr.hasNext()) { final E e = itr.next(); if (ndx.remove(e.name) != null) { n++; } } return n; }
/** * Simple delete implementation works fine for a local journal. */ public long delete(final IChunkedOrderedIterator<E> itr) { long n = 0; final IIndex ndx = getIndex(primaryKeyOrder); while (itr.hasNext()) { final E e = itr.next(); if (ndx.remove(e.name) != null) { n++; } } return n; }
public ISPO next() { canRemove = false; ISPO current = null; if (src.hasNext()) { current = src.next(); processSameAs2and3(current); canRemove = true; } else { if (sameAs2and3It == null) { if (sameAs2and3 != null) { sameAs2and3It = sameAs2and3.getAccessPath(SPOKeyOrder.SPO).iterator(); } else { sameAs2and3It = new EmptyChunkedIterator<ISPO>(SPOKeyOrder.SPO); } } if (sameAs2and3It.hasNext()) { current = sameAs2and3It.next(); } } return current; }
public ISPO next() { canRemove = false; ISPO current = null; if (src.hasNext()) { current = src.next(); processSameAs2and3(current); canRemove = true; } else { if (sameAs2and3It == null) { if (sameAs2and3 != null) { sameAs2and3It = sameAs2and3.getAccessPath(SPOKeyOrder.SPO).iterator(); } else { sameAs2and3It = new EmptyChunkedIterator<ISPO>(SPOKeyOrder.SPO); } } if (sameAs2and3It.hasNext()) { current = sameAs2and3It.next(); } } return current; }