org.apache.flink.streaming.api.windowing.evictors.Evictor Java Examples

The following examples show how to use org.apache.flink.streaming.api.windowing.evictors.Evictor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JoinedStreams.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@PublicEvolving
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {

	this.input1 = requireNonNull(input1);
	this.input2 = requireNonNull(input2);

	this.keySelector1 = requireNonNull(keySelector1);
	this.keySelector2 = requireNonNull(keySelector2);
	this.keyType = requireNonNull(keyType);

	this.windowAssigner = requireNonNull(windowAssigner);

	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #2
Source File: CoGroupedStreams.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {
	this.input1 = input1;
	this.input2 = input2;

	this.keySelector1 = keySelector1;
	this.keySelector2 = keySelector2;
	this.keyType = keyType;

	this.windowAssigner = windowAssigner;
	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #3
Source File: EvictingWindowOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
public EvictingWindowOperator(WindowAssigner<? super IN, W> windowAssigner,
		TypeSerializer<W> windowSerializer,
		KeySelector<IN, K> keySelector,
		TypeSerializer<K> keySerializer,
		StateDescriptor<? extends ListState<StreamRecord<IN>>, ?> windowStateDescriptor,
		InternalWindowFunction<Iterable<IN>, OUT, K, W> windowFunction,
		Trigger<? super IN, ? super W> trigger,
		Evictor<? super IN, ? super W> evictor,
		long allowedLateness,
		OutputTag<IN> lateDataOutputTag) {

	super(windowAssigner, windowSerializer, keySelector,
		keySerializer, null, windowFunction, trigger, allowedLateness, lateDataOutputTag);

	this.evictor = checkNotNull(evictor);
	this.evictingWindowStateDescriptor = checkNotNull(windowStateDescriptor);
}
 
Example #4
Source File: EvictingWindowOperator.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public EvictingWindowOperator(WindowAssigner<? super IN, W> windowAssigner,
		TypeSerializer<W> windowSerializer,
		KeySelector<IN, K> keySelector,
		TypeSerializer<K> keySerializer,
		StateDescriptor<? extends ListState<StreamRecord<IN>>, ?> windowStateDescriptor,
		InternalWindowFunction<Iterable<IN>, OUT, K, W> windowFunction,
		Trigger<? super IN, ? super W> trigger,
		Evictor<? super IN, ? super W> evictor,
		long allowedLateness,
		OutputTag<IN> lateDataOutputTag) {

	super(windowAssigner, windowSerializer, keySelector,
		keySerializer, null, windowFunction, trigger, allowedLateness, lateDataOutputTag);

	this.evictor = checkNotNull(evictor);
	this.evictingWindowStateDescriptor = checkNotNull(windowStateDescriptor);
}
 
Example #5
Source File: CoGroupedStreams.java    From flink with Apache License 2.0 6 votes vote down vote up
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {
	this.input1 = input1;
	this.input2 = input2;

	this.keySelector1 = keySelector1;
	this.keySelector2 = keySelector2;
	this.keyType = keyType;

	this.windowAssigner = windowAssigner;
	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #6
Source File: JoinedStreams.java    From flink with Apache License 2.0 6 votes vote down vote up
@PublicEvolving
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {

	this.input1 = requireNonNull(input1);
	this.input2 = requireNonNull(input2);

	this.keySelector1 = requireNonNull(keySelector1);
	this.keySelector2 = requireNonNull(keySelector2);
	this.keyType = requireNonNull(keyType);

	this.windowAssigner = requireNonNull(windowAssigner);

	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #7
Source File: CoGroupedStreams.java    From flink with Apache License 2.0 6 votes vote down vote up
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {
	this.input1 = input1;
	this.input2 = input2;

	this.keySelector1 = keySelector1;
	this.keySelector2 = keySelector2;
	this.keyType = keyType;

	this.windowAssigner = windowAssigner;
	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #8
Source File: JoinedStreams.java    From flink with Apache License 2.0 6 votes vote down vote up
@PublicEvolving
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor,
		Time allowedLateness) {

	this.input1 = requireNonNull(input1);
	this.input2 = requireNonNull(input2);

	this.keySelector1 = requireNonNull(keySelector1);
	this.keySelector2 = requireNonNull(keySelector2);
	this.keyType = requireNonNull(keyType);

	this.windowAssigner = requireNonNull(windowAssigner);

	this.trigger = trigger;
	this.evictor = evictor;

	this.allowedLateness = allowedLateness;
}
 
Example #9
Source File: EvictingWindowOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
public EvictingWindowOperator(WindowAssigner<? super IN, W> windowAssigner,
		TypeSerializer<W> windowSerializer,
		KeySelector<IN, K> keySelector,
		TypeSerializer<K> keySerializer,
		StateDescriptor<? extends ListState<StreamRecord<IN>>, ?> windowStateDescriptor,
		InternalWindowFunction<Iterable<IN>, OUT, K, W> windowFunction,
		Trigger<? super IN, ? super W> trigger,
		Evictor<? super IN, ? super W> evictor,
		long allowedLateness,
		OutputTag<IN> lateDataOutputTag) {

	super(windowAssigner, windowSerializer, keySelector,
		keySerializer, null, windowFunction, trigger, allowedLateness, lateDataOutputTag);

	this.evictor = checkNotNull(evictor);
	this.evictingWindowStateDescriptor = checkNotNull(windowStateDescriptor);
}
 
Example #10
Source File: WindowedStream.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static String generateOperatorName(
		WindowAssigner<?, ?> assigner,
		Trigger<?, ?> trigger,
		@Nullable Evictor<?, ?> evictor,
		Function function1,
		@Nullable Function function2) {
	return "Window(" +
		assigner + ", " +
		trigger.getClass().getSimpleName() + ", " +
		(evictor == null ? "" : (evictor.getClass().getSimpleName() + ", ")) +
		generateFunctionName(function1) +
		(function2 == null ? "" : (", " + generateFunctionName(function2))) +
		")";
}
 
Example #11
Source File: WindowedStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private static String generateOperatorName(
		WindowAssigner<?, ?> assigner,
		Trigger<?, ?> trigger,
		@Nullable Evictor<?, ?> evictor,
		Function function1,
		@Nullable Function function2) {
	return "Window(" +
		assigner + ", " +
		trigger.getClass().getSimpleName() + ", " +
		(evictor == null ? "" : (evictor.getClass().getSimpleName() + ", ")) +
		generateFunctionName(function1) +
		(function2 == null ? "" : (", " + generateFunctionName(function2))) +
		")";
}
 
Example #12
Source File: WindowedStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private static String generateOperatorName(
		WindowAssigner<?, ?> assigner,
		Trigger<?, ?> trigger,
		@Nullable Evictor<?, ?> evictor,
		Function function1,
		@Nullable Function function2) {
	return "Window(" +
		assigner + ", " +
		trigger.getClass().getSimpleName() + ", " +
		(evictor == null ? "" : (evictor.getClass().getSimpleName() + ", ")) +
		generateFunctionName(function1) +
		(function2 == null ? "" : (", " + generateFunctionName(function2))) +
		")";
}
 
Example #13
Source File: EvictingWindowOperator.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public Evictor<? super IN, ? super W> getEvictor() {
	return evictor;
}
 
Example #14
Source File: EvictingWindowOperator.java    From flink with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public Evictor<? super IN, ? super W> getEvictor() {
	return evictor;
}
 
Example #15
Source File: EvictingWindowOperator.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public Evictor<? super IN, ? super W> getEvictor() {
	return evictor;
}
 
Example #16
Source File: CoGroupedStreams.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before
 * emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}
 
Example #17
Source File: JoinedStreams.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}
 
Example #18
Source File: JoinedStreams.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}
 
Example #19
Source File: CoGroupedStreams.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before
 * emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}
 
Example #20
Source File: CoGroupedStreams.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before
 * emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}
 
Example #21
Source File: JoinedStreams.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@code Evictor} that should be used to evict elements from a window before emission.
 *
 * <p>Note: When using an evictor window performance will degrade significantly, since
 * pre-aggregation of window results cannot be used.
 */
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
	return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
			windowAssigner, trigger, newEvictor, allowedLateness);
}