public class RMQSink<IN> extends RichSinkFunction<IN>
Constructor and Description |
---|
RMQSink(String HOST_NAME,
String QUEUE_NAME,
SerializationSchema<IN> schema) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Tear-down method for the user code.
|
void |
initializeConnection()
Initializes the connection to RMQ.
|
void |
invoke(IN value)
Called when new data arrives to the sink, and forwards it to RMQ.
|
void |
open(Configuration config)
Initialization method for the function.
|
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public RMQSink(String HOST_NAME, String QUEUE_NAME, SerializationSchema<IN> schema)
public void initializeConnection()
public void invoke(IN value)
invoke
in interface SinkFunction<IN>
invoke
in class RichSinkFunction<IN>
value
- The incoming datapublic 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
public void close()
RichFunction
This method can be used for clean up work.
close
in interface RichFunction
close
in class AbstractRichFunction
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.