/** * Creates a {@code DeltaEvictor} from the given threshold, {@code DeltaFunction}. * Eviction is done before/after the window function based on the value of doEvictAfter. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} * @param doEvictAfter Whether eviction should be done after window function */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter) { return new DeltaEvictor<>(threshold, deltaFunction, doEvictAfter); } }
@Override public void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (!doEvictAfter) { evict(elements, size, ctx); } }
new InternalIterableWindowFunction<>(new RichSumReducer<GlobalWindow>(closeCalled)), CountTrigger.of(triggerCount), DeltaEvictor.of(threshold, new DeltaFunction<Tuple2<String, Integer>>() { @Override public double getDelta(Tuple2<String, Integer> oldDataPoint, Tuple2<String, Integer> newDataPoint) {
new InternalIterableWindowFunction<>(new RichSumReducer<GlobalWindow>(closeCalled)), CountTrigger.of(triggerCount), DeltaEvictor.of(threshold, new DeltaFunction<Tuple2<String, Integer>>() { @Override public double getDelta(Tuple2<String, Integer> oldDataPoint, Tuple2<String, Integer> newDataPoint) {
/** * Creates a {@code DeltaEvictor} from the given threshold and {@code DeltaFunction}. * Eviction is done before the window function. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) { return new DeltaEvictor<>(threshold, deltaFunction); }
@Override public void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold and {@code DeltaFunction}. * Eviction is done before the window function. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) { return new DeltaEvictor<>(threshold, deltaFunction); }
@Override public void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (!doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold, {@code DeltaFunction}. * Eviction is done before/after the window function based on the value of doEvictAfter. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} * @param doEvictAfter Whether eviction should be done after window function */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter) { return new DeltaEvictor<>(threshold, deltaFunction, doEvictAfter); } }
@Override public void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (!doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold, {@code DeltaFunction}. * Eviction is done before/after the window function based on the value of doEvictAfter. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} * @param doEvictAfter Whether eviction should be done after window function */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter) { return new DeltaEvictor<>(threshold, deltaFunction, doEvictAfter); } }
@Override public void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (!doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold and {@code DeltaFunction}. * Eviction is done before the window function. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) { return new DeltaEvictor<>(threshold, deltaFunction); }
@Override public void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold, {@code DeltaFunction}. * Eviction is done before/after the window function based on the value of doEvictAfter. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} * @param doEvictAfter Whether eviction should be done after window function */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter) { return new DeltaEvictor<>(threshold, deltaFunction, doEvictAfter); } }
@Override public void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (doEvictAfter) { evict(elements, size, ctx); } }
/** * Creates a {@code DeltaEvictor} from the given threshold and {@code DeltaFunction}. * Eviction is done before the window function. * * @param threshold The threshold * @param deltaFunction The {@code DeltaFunction} */ public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) { return new DeltaEvictor<>(threshold, deltaFunction); }
@Override public void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, EvictorContext ctx) { if (doEvictAfter) { evict(elements, size, ctx); } }