/** * Attaches a stage that passes through just the items that are distinct * within their window according to the grouping key (no two items emitted * for a window map to the same key). There is no guarantee which one of * the items with the same key will pass through. The stage emits results * in the form of {@link TimestampedItem TimestampedItem(windowEnd, * distinctItem)}. * * @return the newly attached stage */ @Nonnull default StreamStage<TimestampedItem<T>> distinct() { return distinct(TimestampedItem::fromWindowResult); }
/** * Attaches a stage that passes through just the items that are distinct * within their window (no two items emitted for a window are equal). There * is no guarantee among the items with the same key which one it will pass * through. To create the item to emit, the stage calls the supplied {@code * mapToOutputFn}. * * @param mapToOutputFn function that returns the items to emit * @return the newly attached stage */ @Nonnull default <R> StreamStage<R> distinct(@Nonnull WindowResultFunction<? super T, ? extends R> mapToOutputFn) { return groupingKey(wholeItem()).distinct(mapToOutputFn); }
/** * Attaches a stage that passes through just the items that are distinct * within their window (no two items emitted for a window are equal). There * is no guarantee which one of the items with the same key will pass * through. The stage emits results in the form of {@link TimestampedItem * TimestampedItem(windowEnd, distinctItem)}. * * @return the newly attached stage */ @Nonnull default StreamStage<TimestampedItem<T>> distinct() { return groupingKey(wholeItem()).distinct(); }