public static final class SideOutputExample.Tokenizer extends ProcessFunction<String,Tuple2<String,Integer>>
Tuple2<String,
Integer>
).
This rejects words that are longer than 5 characters long.
ProcessFunction.Context, ProcessFunction.OnTimerContext
Constructor and Description |
---|
Tokenizer() |
Modifier and Type | Method and Description |
---|---|
void |
processElement(String value,
ProcessFunction.Context ctx,
Collector<Tuple2<String,Integer>> out)
Process one element from the input stream.
|
onTimer
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
public void processElement(String value, ProcessFunction.Context ctx, Collector<Tuple2<String,Integer>> out) throws Exception
ProcessFunction
This function can output zero or more elements using the Collector
parameter
and also update internal state or set timers using the ProcessFunction.Context
parameter.
processElement
in class ProcessFunction<String,Tuple2<String,Integer>>
value
- The input value.ctx
- A ProcessFunction.Context
that allows querying the timestamp of the element and getting
a TimerService
for registering timers and querying the time. The
context is only valid during the invocation of this method, do not store it.out
- The collector for returning result values.Exception
- This method may throw exceptions. Throwing an exception will cause the operation
to fail and may trigger recovery.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.