@Test public void errorAndLimitInChild() { CompletableFuture<Integer> future = new CompletableFuture<>(); RecordCursor<Integer> cursor = UnorderedUnionCursor.create(Arrays.asList( continuation -> RecordCursor.fromList(Arrays.asList(1, 2), continuation).limitRowsTo(1), continuation -> RecordCursor.fromFuture(future) ), null, null); RecordCursorResult<Integer> cursorResult = cursor.getNext(); assertEquals(1, (int)cursorResult.get()); CompletableFuture<RecordCursorResult<Integer>> cursorResultFuture = cursor.onNext(); final RecordCoreException ex = new RecordCoreException("something bad happened!"); future.completeExceptionally(ex); ExecutionException executionException = assertThrows(ExecutionException.class, cursorResultFuture::get); assertNotNull(executionException.getCause()); assertSame(ex, executionException.getCause()); }
@Nonnull public static <T> UnorderedUnionCursor<T> create( @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions, @Nullable byte[] continuation, @Nullable FDBStoreTimer timer) { return new UnorderedUnionCursor<>(createCursorStates(cursorFunctions, continuation), timer); }
UnorderedUnionCursor extends UnionCursorBase<T, MergeCursorState<T>> { @Nonnull public static <T> UnorderedUnionCursor<T> create( @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions, @Nullable byte[] continuation, @Nullable FDBStoreTimer timer) { return new UnorderedUnionCursor<>(createCursorStates(cursorFunctions, continuation), timer); } }
UnorderedUnionCursor extends UnionCursorBase<T, MergeCursorState<T>> { @Nonnull public static <T> UnorderedUnionCursor<T> create( @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions, @Nullable byte[] continuation, @Nullable FDBStoreTimer timer) { return new UnorderedUnionCursor<>(createCursorStates(cursorFunctions, continuation), timer); } protected  UnorderedUnionCursor(@Nonnull List<MergeCursorState<T>> cursorStates,
                                   @Nullable FDBStoreTimer timer); }
UnorderedUnionCursor extends UnionCursorBase<T, MergeCursorState<T>> { @Nonnull public static <T> UnorderedUnionCursor<T> create( @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions, @Nullable byte[] continuation, @Nullable FDBStoreTimer timer) { return new UnorderedUnionCursor<>(createCursorStates(cursorFunctions, continuation), timer); } protected  UnorderedUnionCursor(@Nonnull List<MergeCursorState<T>> cursorStates,
                                   @Nullable FDBStoreTimer timer); @Nonnull static UnorderedUnionCursor<T> create(
            @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions,
            @Nullable byte[] continuation,
            @Nullable FDBStoreTimer timer); }
UnorderedUnionCursor extends UnionCursorBase<T, MergeCursorState<T>> { @Nonnull public static <T> UnorderedUnionCursor<T> create( @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions, @Nullable byte[] continuation, @Nullable FDBStoreTimer timer) { return new UnorderedUnionCursor<>(createCursorStates(cursorFunctions, continuation), timer); } protected  UnorderedUnionCursor(@Nonnull List<MergeCursorState<T>> cursorStates,
                                   @Nullable FDBStoreTimer timer); @Nonnull static UnorderedUnionCursor<T> create(
            @Nonnull List<Function<byte[], RecordCursor<T>>> cursorFunctions,
            @Nullable byte[] continuation,
            @Nullable FDBStoreTimer timer);  }