IN
- Input record type@PublicEvolving public class PrintSinkFunction<IN> extends RichSinkFunction<IN>
SinkFunction.Context<T>
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.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Tear-down method for the user code.
|
void |
invoke(IN record) |
void |
open(Configuration parameters)
Initialization method for the function.
|
void |
setTargetToStandardErr() |
void |
setTargetToStandardOut() |
String |
toString() |
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invoke
public PrintSinkFunction()
public PrintSinkFunction(boolean stdErr)
stdErr
- True, if the format should print to standard error instead of standard out.public void setTargetToStandardOut()
public void setTargetToStandardErr()
public 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 MyMapper extends FilterFunction<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)
public void close()
RichFunction
This method can be used for clean up work.
close
in interface RichFunction
close
in class AbstractRichFunction
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.