@Override public void begin() { isTransaction = true; snapshotted.forEach((k,v) -> v.clear()); added.forEach((k,v) -> v.clear()); }
protected void clearResources() { stashedObjects = 0; buffer.clear(); stashed.forEach((k,v) -> v.clear()); }
assertTrue(recs.isEmpty()); candidates.clear(); candidates.add(6); candidates.add(7);
/** * Clears the HLL. The HLL will have cardinality zero and will act as if no * elements have been added.<p/> * * NOTE: Unlike {@link #addRaw(long)}, <code>clear</code> does NOT handle * transitions between {@link HLLType}s - a probabilistic type will remain * probabilistic after being cleared. */ public void clear() { switch(type) { case EMPTY: return /*do nothing*/; case EXPLICIT: explicitStorage.clear(); return; case SPARSE: sparseProbabilisticStorage.clear(); return; case FULL: probabilisticStorage.fill(0); return; default: throw new RuntimeException("Unsupported HLL type " + type); } }
/** * Clears the HLL. The HLL will have cardinality zero and will act as if no * elements have been added.<p/> * * NOTE: Unlike {@link #addRaw(long)}, <code>clear</code> does NOT handle * transitions between {@link HLLType}s - a probabilistic type will remain * probabilistic after being cleared. */ public void clear() { switch(type) { case EMPTY: return /*do nothing*/; case EXPLICIT: explicitStorage.clear(); return; case SPARSE: sparseProbabilisticStorage.clear(); return; case FULL: probabilisticStorage.fill(0); return; default: throw new RuntimeException("Unsupported HLL type " + type); } }
@SuppressWarnings("unchecked") public long nextLong() { if ( !hasNext() ) throw new NoSuchElementException(); ObjectList<Scan.VirtualDocumentFragment> vdfList; try { vdfList = (ObjectList<VirtualDocumentFragment>)cachedDocument.content( virtualField ); } catch ( IOException e ) { throw new RuntimeException( e.getMessage(), e ); } succ.clear(); resolver.context( cachedDocument ); ObjectIterator<VirtualDocumentFragment> it = vdfList.iterator(); while ( it.hasNext() ) { final long successor = resolver.resolve( it.next().documentSpecifier() ); if ( successor >= 0 ) succ.add( successor ); } cachedSuccessors = succ.toLongArray(); Arrays.sort( cachedSuccessors ); // Get ready for the next request try { cachedDocument.close(); cachedDocument = documentIterator.nextDocument(); } catch ( IOException e ) { throw new RuntimeException( e ); } return cachedDocumentNumber++; }
alreadySeen.clear(); for( int i = 0, p = 0; i != indexIterator.length; i++ ) if ( indexIterator[ i ].frequency() != 0 && alreadySeen.add( indexIterator[ i ].termNumber() ) ) flatIndexIterator[ p++ ] = indexIterator[ i ];