public class FlumeSink<IN> extends RichSinkFunction<IN>
Constructor and Description |
---|
FlumeSink(String host,
int port,
SerializationSchema<IN> schema) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Tear-down method for the user code.
|
void |
invoke(IN value)
Receives tuples from the Apache Flink
DataStream and forwards
them to Apache Flume. |
void |
open(Configuration config)
Initialization method for the function.
|
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public FlumeSink(String host, int port, SerializationSchema<IN> schema)
public void invoke(IN value)
DataStream
and forwards
them to Apache Flume.invoke
in interface SinkFunction<IN>
invoke
in class RichSinkFunction<IN>
value
- The tuple arriving from the datastreampublic void close()
RichFunction
This method can be used for clean up work.
close
in interface RichFunction
close
in class AbstractRichFunction
public void open(Configuration config)
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
config
- The configuration containing the parameters attached to the contract.Configuration
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.