Class MergeCursorState<T>
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.cursors.MergeCursorState<T>
-
- Type Parameters:
T
- the type of elements returned by the underlying cursor
- All Implemented Interfaces:
AutoCloseable
@API(INTERNAL) public class MergeCursorState<T> extends Object implements AutoCloseable
A holder for mutable state needed to track one of the children cursors of some merge operation. This includes the cursor itself as well as information tracking the progress including continuation information. Subclasses may add additional information such as a comparison key or value (for ordered cursors).
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MergeCursorState(RecordCursor<T> cursor, RecordCursorContinuation continuation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
consume()
static <T> MergeCursorState<T>
from(Function<byte[],RecordCursor<T>> cursorFunction, RecordCursorContinuation continuation)
RecordCursorContinuation
getContinuation()
RecordCursor<T>
getCursor()
Executor
getExecutor()
CompletableFuture<RecordCursorResult<T>>
getOnNextFuture()
RecordCursorResult<T>
getResult()
protected void
handleNextCursorResult(RecordCursorResult<T> cursorResult)
boolean
mightHaveNext()
Return whether this cursor may return a result in the future.
-
-
-
Constructor Detail
-
MergeCursorState
protected MergeCursorState(@Nonnull RecordCursor<T> cursor, @Nonnull RecordCursorContinuation continuation)
-
-
Method Detail
-
handleNextCursorResult
protected void handleNextCursorResult(@Nonnull RecordCursorResult<T> cursorResult)
-
getOnNextFuture
@Nonnull public CompletableFuture<RecordCursorResult<T>> getOnNextFuture()
-
consume
public void consume()
-
mightHaveNext
public boolean mightHaveNext()
Return whether this cursor may return a result in the future. In particular, this will returntrue
if this cursor has either not returned its first result or if the most recent result had a next element.- Returns:
- whether the cursor might have more results
-
getResult
@Nullable public RecordCursorResult<T> getResult()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
getCursor
@Nonnull public RecordCursor<T> getCursor()
-
getContinuation
@Nonnull public RecordCursorContinuation getContinuation()
-
from
@Nonnull public static <T> MergeCursorState<T> from(@Nonnull Function<byte[],RecordCursor<T>> cursorFunction, @Nonnull RecordCursorContinuation continuation)
-
-