IN
- Input record type@PublicEvolving public class PrintSinkFunction<IN> extends RichSinkFunction<IN>
Four possible format options: sinkIdentifier
:taskId> output <- sinkIdentifier
provided, parallelism > 1 sinkIdentifier
> output <- sinkIdentifier
provided,
parallelism == 1 taskId> output <- no sinkIdentifier
provided, parallelism > 1 output <-
no sinkIdentifier
provided, parallelism == 1
SinkFunction.Context
Constructor and Description |
---|
PrintSinkFunction()
Instantiates a print sink function that prints to standard out.
|
PrintSinkFunction(boolean stdErr)
Instantiates a print sink function that prints to standard out.
|
PrintSinkFunction(String sinkIdentifier,
boolean stdErr)
Instantiates a print sink function that prints to standard out and gives a sink identifier.
|
Modifier and Type | Method and Description |
---|---|
void |
invoke(IN record) |
void |
open(Configuration parameters)
Initialization method for the function.
|
String |
toString() |
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
finish, invoke, writeWatermark
public PrintSinkFunction()
public PrintSinkFunction(boolean stdErr)
stdErr
- True, if the format should print to standard error instead of standard out.public PrintSinkFunction(String sinkIdentifier, boolean stdErr)
stdErr
- True, if the format should print to standard error instead of standard out.sinkIdentifier
- Message that identify sink and is prefixed to the output of the valuepublic void open(Configuration parameters) throws Exception
RichFunction
The configuration object passed to the function can be used for configuration and initialization. The configuration contains all parameters that were configured on the function in the program composition.
public class MyFilter extends RichFilterFunction<String> {
private String searchString;
public void open(Configuration parameters) {
this.searchString = parameters.getString("foo");
}
public boolean filter(String value) {
return value.equals(searchString);
}
}
By default, this method does nothing.
open
in interface RichFunction
open
in class AbstractRichFunction
parameters
- The configuration containing the parameters attached to the contract.Exception
- Implementations may forward exceptions, which are caught by the runtime.
When the runtime catches an exception, it aborts the task and lets the fail-over logic
decide whether to retry the task execution.Configuration
public void invoke(IN record)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.