/** * Creates a delta trigger from the given threshold and {@code DeltaFunction}. * * @param threshold The threshold at which to trigger. * @param deltaFunction The delta function to use * @param stateSerializer TypeSerializer for the data elements. * * @param <T> The type of elements on which this trigger can operate. * @param <W> The type of {@link Window Windows} on which this trigger can operate. */ public static <T, W extends Window> DeltaTrigger<T, W> of(double threshold, DeltaFunction<T> deltaFunction, TypeSerializer<T> stateSerializer) { return new DeltaTrigger<>(threshold, deltaFunction, stateSerializer); } }
.window(GlobalWindows.create()) .evictor(TimeEvictor.of(Time.of(evictionSec, TimeUnit.SECONDS))) .trigger(DeltaTrigger.of(triggerMeters, new DeltaFunction<Tuple4<Integer, Integer, Double, Long>>() { private static final long serialVersionUID = 1L;
.window(GlobalWindows.create()) .evictor(TimeEvictor.of(Time.of(evictionSec, TimeUnit.SECONDS))) .trigger(DeltaTrigger.of(triggerMeters, new DeltaFunction<Tuple4<Integer, Integer, Double, Long>>() { private static final long serialVersionUID = 1L;
/** * Creates a delta trigger from the given threshold and {@code DeltaFunction}. * * @param threshold The threshold at which to trigger. * @param deltaFunction The delta function to use * @param stateSerializer TypeSerializer for the data elements. * * @param <T> The type of elements on which this trigger can operate. * @param <W> The type of {@link Window Windows} on which this trigger can operate. */ public static <T, W extends Window> DeltaTrigger<T, W> of(double threshold, DeltaFunction<T> deltaFunction, TypeSerializer<T> stateSerializer) { return new DeltaTrigger<>(threshold, deltaFunction, stateSerializer); } }
/** * Creates a delta trigger from the given threshold and {@code DeltaFunction}. * * @param threshold The threshold at which to trigger. * @param deltaFunction The delta function to use * @param stateSerializer TypeSerializer for the data elements. * * @param <T> The type of elements on which this trigger can operate. * @param <W> The type of {@link Window Windows} on which this trigger can operate. */ public static <T, W extends Window> DeltaTrigger<T, W> of(double threshold, DeltaFunction<T> deltaFunction, TypeSerializer<T> stateSerializer) { return new DeltaTrigger<>(threshold, deltaFunction, stateSerializer); } }
/** * Creates a delta trigger from the given threshold and {@code DeltaFunction}. * * @param threshold The threshold at which to trigger. * @param deltaFunction The delta function to use * @param stateSerializer TypeSerializer for the data elements. * * @param <T> The type of elements on which this trigger can operate. * @param <W> The type of {@link Window Windows} on which this trigger can operate. */ public static <T, W extends Window> DeltaTrigger<T, W> of(double threshold, DeltaFunction<T> deltaFunction, TypeSerializer<T> stateSerializer) { return new DeltaTrigger<>(threshold, deltaFunction, stateSerializer); } }