@Override public void close() throws Exception { closeCursors(); }
private void shouldIterateCorrectlyOver( Labels... data ) throws Exception { // GIVEN try ( AllEntriesLabelScanReader reader = new NativeAllEntriesLabelScanReader( store( data ), highestLabelId( data ) ) ) { // WHEN/THEN assertRanges( reader, data ); } }
return new NativeAllEntriesLabelScanReader( seekProvider, highestLabelId );
return new NativeAllEntriesLabelScanReader( seekProvider, highestLabelId );
@Override public Iterator<NodeLabelRange> iterator() { try { long lowestRange = Long.MAX_VALUE; closeCursors(); for ( int labelId = 0; labelId <= highestLabelId; labelId++ ) { RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor = seekProvider.apply( labelId ); // Bootstrap the cursor, which also provides a great opportunity to exclude if empty if ( cursor.next() ) { lowestRange = min( lowestRange, cursor.get().key().idRange ); cursors.add( cursor ); } } return new NodeLabelRangeIterator( lowestRange ); } catch ( IOException e ) { throw new RuntimeException( e ); } }
@Override public void close() throws Exception { closeCursors(); }
@Override public Iterator<NodeLabelRange> iterator() { try { long lowestRange = Long.MAX_VALUE; closeCursors(); for ( int labelId = 0; labelId <= highestLabelId; labelId++ ) { RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor = seekProvider.apply( labelId ); // Bootstrap the cursor, which also provides a great opportunity to exclude if empty if ( cursor.next() ) { lowestRange = min( lowestRange, cursor.get().key().idRange ); cursors.add( cursor ); } } return new NodeLabelRangeIterator( lowestRange ); } catch ( IOException e ) { throw new RuntimeException( e ); } }