Class UnorderedUnionCursor<T>

  • Type Parameters:
    T - the type of elements returned by the cursor
    All Implemented Interfaces:
    RecordCursor<T>, AutoCloseable, Iterator<T>

    @API(EXPERIMENTAL)
    public class UnorderedUnionCursor<T>
    extends MergeCursor<T,​T,​S>
    A cursor that returns the results of two or more cursors that may return elements in any order. This cursor makes no guarantees as to the order of elements it returns, and it may return the same element more than once as it does not make any attempt to de-duplicate elements that appear in multiple of its source cursors. It attempts to return elements from its children "as they come", which means that it might be the case that identical cursors of this type may return results in two different orders even if all of its child cursors all return the same results if different children happen to be faster in one run than the other (due to, for example, non-determinism in sending messages across the network).

    If there are limits applied to the children of this cursor, this cursor will continue to emit elements as long as there remains at least one child cursor who has not yet returned its last result. (For example, if this cursor has two children and one of them completes faster than the other due to hitting some limit, then the union cursor will continue returning results from the other cursor.) This differs from the behavior of the ordered UnionCursor.