@Override public boolean hasNext() { return idIterator.hasNext(); }
@Override public boolean hasNext() { return iterator.hasNext(); }
@Override public boolean next() { while ( iterator.hasNext() ) { if ( client.acceptNode( iterator.next(), null ) ) { return true; } } return false; }
@Override public boolean next() { while ( ids.hasNext() ) { if ( client.acceptNode( ids.next(), (Value[]) null ) ) { return true; } } return false; }
@Override public void close() throws IndexEntryConflictException { actual.close(); try ( IndexReader reader = readerSupplier.get() ) { for ( ValueTuple tuple : touchedTuples ) { try ( PrimitiveLongResourceIterator results = reader.query( queryOf( tuple ) ) ) { if ( results.hasNext() ) { long firstEntityId = results.next(); if ( results.hasNext() ) { long secondEntityId = results.next(); throw new IndexEntryConflictException( firstEntityId, secondEntityId, tuple ); } } } } } catch ( IndexNotApplicableKernelException e ) { throw new IllegalArgumentException( "Unexpectedly the index reader couldn't handle this query", e ); } }
private void assertContent( PrimitiveLongResourceIterator iterator, long... expected ) { int i = 0; while ( iterator.hasNext() ) { assertEquals( expected[i++], iterator.next(), "has expected value" ); } assertEquals( expected.length, i, "has all expected values" ); }
@Override protected boolean fetchNext() { if ( mainResult.hasNext() ) { long mainValue = mainResult.next(); if ( !otherResult.hasNext() ) { throw new IllegalStateException( format( "Legacy query method returned %d, but new query method didn't have more values in it", mainValue ) ); } long otherValue = otherResult.next(); if ( mainValue != otherValue ) { throw new IllegalStateException( format( "Query methods disagreeing on next value legacy:%d new:%d", mainValue, otherValue ) ); } return next( mainValue ); } else if ( otherResult.hasNext() ) { throw new IllegalStateException( format( "Legacy query method exhausted, but new query method had more %d", otherResult.next() ) ); } return false; }
@Override public boolean hasNext() { return iterator.hasNext(); }
@Override public boolean hasNext() { return idIterator.hasNext(); }
@Override public boolean next() { while ( iterator.hasNext() ) { if ( client.acceptNode( iterator.next(), null ) ) { return true; } } return false; }
@Override public boolean next() { while ( ids.hasNext() ) { if ( client.acceptNode( ids.next(), (Value[]) null ) ) { return true; } } return false; }
@Override public void close() throws IndexEntryConflictException { actual.close(); try ( IndexReader reader = readerSupplier.get() ) { for ( ValueTuple tuple : touchedTuples ) { try ( PrimitiveLongResourceIterator results = reader.query( queryOf( tuple ) ) ) { if ( results.hasNext() ) { long firstEntityId = results.next(); if ( results.hasNext() ) { long secondEntityId = results.next(); throw new IndexEntryConflictException( firstEntityId, secondEntityId, tuple ); } } } } } catch ( IndexNotApplicableKernelException e ) { throw new IllegalArgumentException( "Unexpectedly the index reader couldn't handle this query", e ); } }