@Test public void emptyScan() { fdb.run(context -> { RecordCursor<KeyValue> cursor = KeyValueCursor.Builder.withSubspace(subspace) .setContext(context) .setRange(TupleRange.allOf(Tuple.from(9))) .setContinuation(null) .setScanProperties(ScanProperties.FORWARD_SCAN) .build(); RecordCursorResult<KeyValue> result = cursor.getNext(); assertFalse(result.hasNext()); assertEquals(RecordCursor.NoNextReason.SOURCE_EXHAUSTED, result.getNoNextReason()); assertTrue(result.getContinuation().isEnd()); return null; }); }
@Override @Nonnull public RecordCursorResult<KeyValue> getNext() { return context.asyncToSync(FDBStoreTimer.Waits.WAIT_ADVANCE_CURSOR, onNext()); }
KeyValueCursor extends AsyncIteratorCursor<KeyValue> implements BaseCursor<KeyValue> { @Override @Nonnull public RecordCursorResult<KeyValue> getNext() { return context.asyncToSync(FDBStoreTimer.Waits.WAIT_ADVANCE_CURSOR, onNext()); } }
KeyValueCursor extends AsyncIteratorCursor<KeyValue> implements BaseCursor<KeyValue> { @Override @Nonnull public RecordCursorResult<KeyValue> getNext() { return context.asyncToSync(FDBStoreTimer.Waits.WAIT_ADVANCE_CURSOR, onNext()); } private  KeyValueCursor(@Nonnull final FDBRecordContext context,
                           @Nonnull final AsyncIterator<KeyValue> iterator,
                           int prefixLength,
                           @Nonnull final CursorLimitManager limitManager,
                           int valuesLimit); }
KeyValueCursor extends AsyncIteratorCursor<KeyValue> implements BaseCursor<KeyValue> { @Override @Nonnull public RecordCursorResult<KeyValue> getNext() { return context.asyncToSync(FDBStoreTimer.Waits.WAIT_ADVANCE_CURSOR, onNext()); } private  KeyValueCursor(@Nonnull final FDBRecordContext context,
                           @Nonnull final AsyncIterator<KeyValue> iterator,
                           int prefixLength,
                           @Nonnull final CursorLimitManager limitManager,
                           int valuesLimit); @Nonnull @Override CompletableFuture<RecordCursorResult<KeyValue>> onNext(); @Override @Nonnull RecordCursorResult<KeyValue> getNext(); }
KeyValueCursor extends AsyncIteratorCursor<KeyValue> implements BaseCursor<KeyValue> { @Override @Nonnull public RecordCursorResult<KeyValue> getNext() { return context.asyncToSync(FDBStoreTimer.Waits.WAIT_ADVANCE_CURSOR, onNext()); } private  KeyValueCursor(@Nonnull final FDBRecordContext context,
                           @Nonnull final AsyncIterator<KeyValue> iterator,
                           int prefixLength,
                           @Nonnull final CursorLimitManager limitManager,
                           int valuesLimit); @Nonnull @Override CompletableFuture<RecordCursorResult<KeyValue>> onNext(); @Override @Nonnull RecordCursorResult<KeyValue> getNext();  }