Java Code Examples for org.apache.flink.state.api.functions.KeyedStateReaderFunction#Context
The following examples show how to use
org.apache.flink.state.api.functions.KeyedStateReaderFunction#Context .
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: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 5 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { Set<Long> eventTimers = ctx.registeredEventTimeTimers(); Assert.assertEquals("Each key should have exactly one event timer for key " + key, 1, eventTimers.size()); out.collect(eventTimers.iterator().next().intValue()); Set<Long> procTimers = ctx.registeredProcessingTimeTimers(); Assert.assertEquals("Each key should have exactly one processing timer for key " + key, 1, procTimers.size()); out.collect(procTimers.iterator().next().intValue()); }
Example 2
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 5 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { Set<Long> eventTimers = ctx.registeredEventTimeTimers(); Assert.assertEquals("Each key should have exactly one event timer for key " + key, 1, eventTimers.size()); out.collect(eventTimers.iterator().next().intValue()); Set<Long> procTimers = ctx.registeredProcessingTimeTimers(); Assert.assertEquals("Each key should have exactly one processing timer for key " + key, 1, procTimers.size()); out.collect(procTimers.iterator().next().intValue()); }
Example 3
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { out.collect(state.value()); }
Example 4
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { out.collect(state.value()); out.collect(state.value()); }
Example 5
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { ValueState<Integer> state = getRuntimeContext().getState(stateDescriptor); out.collect(state.value()); }
Example 6
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { out.collect(state.value()); }
Example 7
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { out.collect(state.value()); out.collect(state.value()); }
Example 8
Source File: KeyedStateInputFormatTest.java From flink with Apache License 2.0 | 4 votes |
@Override public void readKey(Integer key, KeyedStateReaderFunction.Context ctx, Collector<Integer> out) throws Exception { ValueState<Integer> state = getRuntimeContext().getState(stateDescriptor); out.collect(state.value()); }