Java Code Examples for org.apache.flink.streaming.api.TimerService#deleteEventTimeTimer()
The following examples show how to use
org.apache.flink.streaming.api.TimerService#deleteEventTimeTimer() .
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: KeyedProcessOperatorTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); final ValueState<Integer> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT:" + value); state.update(value); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { timerService.registerProcessingTimeTimer(timerService.currentProcessingTime() + 5); } } else { state.clear(); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } else { timerService.deleteProcessingTimeTimer(timerService.currentProcessingTime() + 4); } } }
Example 2
Source File: KeyedProcessOperatorTest.java From flink with Apache License 2.0 | 6 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); final ValueState<Integer> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT:" + value); state.update(value); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { timerService.registerProcessingTimeTimer(timerService.currentProcessingTime() + 5); } } else { state.clear(); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } else { timerService.deleteProcessingTimeTimer(timerService.currentProcessingTime() + 4); } } }
Example 3
Source File: KeyedProcessOperatorTest.java From flink with Apache License 2.0 | 6 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); final ValueState<Integer> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT:" + value); state.update(value); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { timerService.registerProcessingTimeTimer(timerService.currentProcessingTime() + 5); } } else { state.clear(); if (expectedTimeDomain.equals(TimeDomain.EVENT_TIME)) { timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } else { timerService.deleteProcessingTimeTimer(timerService.currentProcessingTime() + 4); } } }
Example 4
Source File: KeyedCoProcessOperatorTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
private void handleValue( Object value, Collector<String> out, TimerService timerService, int channel) throws IOException { final ValueState<String> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT" + channel + ":" + value); state.update(String.valueOf(value)); timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { state.clear(); timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } }
Example 5
Source File: KeyedProcessOperatorTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); timerService.registerProcessingTimeTimer(3); timerService.registerEventTimeTimer(4); timerService.registerProcessingTimeTimer(5); timerService.registerEventTimeTimer(6); timerService.deleteProcessingTimeTimer(3); timerService.deleteEventTimeTimer(4); }
Example 6
Source File: LegacyKeyedCoProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
private void handleValue( Object value, Collector<String> out, TimerService timerService, int channel) throws IOException { final ValueState<String> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT" + channel + ":" + value); state.update(String.valueOf(value)); timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { state.clear(); timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } }
Example 7
Source File: KeyedCoProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
private void handleValue( Object value, Collector<String> out, TimerService timerService, int channel) throws IOException { final ValueState<String> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT" + channel + ":" + value); state.update(String.valueOf(value)); timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { state.clear(); timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } }
Example 8
Source File: KeyedProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); timerService.registerProcessingTimeTimer(3); timerService.registerEventTimeTimer(4); timerService.registerProcessingTimeTimer(5); timerService.registerEventTimeTimer(6); timerService.deleteProcessingTimeTimer(3); timerService.deleteEventTimeTimer(4); }
Example 9
Source File: LegacyKeyedCoProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
private void handleValue( Object value, Collector<String> out, TimerService timerService, int channel) throws IOException { final ValueState<String> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT" + channel + ":" + value); state.update(String.valueOf(value)); timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { state.clear(); timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } }
Example 10
Source File: KeyedCoProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
private void handleValue( Object value, Collector<String> out, TimerService timerService, int channel) throws IOException { final ValueState<String> state = getRuntimeContext().getState(this.state); if (state.value() == null) { out.collect("INPUT" + channel + ":" + value); state.update(String.valueOf(value)); timerService.registerEventTimeTimer(timerService.currentWatermark() + 5); } else { state.clear(); timerService.deleteEventTimeTimer(timerService.currentWatermark() + 4); } }
Example 11
Source File: KeyedProcessOperatorTest.java From flink with Apache License 2.0 | 5 votes |
@Override public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception { final TimerService timerService = ctx.timerService(); timerService.registerProcessingTimeTimer(3); timerService.registerEventTimeTimer(4); timerService.registerProcessingTimeTimer(5); timerService.registerEventTimeTimer(6); timerService.deleteProcessingTimeTimer(3); timerService.deleteEventTimeTimer(4); }