IN
- Type of the elements emitted by this sinkpublic abstract class CassandraSinkBase<IN,V> extends RichSinkFunction<IN>
CassandraPojoSink
and CassandraTupleSink
.Modifier and Type | Field and Description |
---|---|
protected com.google.common.util.concurrent.FutureCallback<V> |
callback |
protected com.datastax.driver.core.Cluster |
cluster |
protected Throwable |
exception |
protected static org.slf4j.Logger |
LOG |
protected com.datastax.driver.core.Session |
session |
Modifier | Constructor and Description |
---|---|
protected |
CassandraSinkBase(ClusterBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Tear-down method for the user code.
|
void |
invoke(IN value)
Function for standard sink behaviour.
|
void |
open(Configuration configuration)
Initialization method for the function.
|
abstract com.google.common.util.concurrent.ListenableFuture<V> |
send(IN value) |
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
protected static final org.slf4j.Logger LOG
protected transient com.datastax.driver.core.Cluster cluster
protected transient com.datastax.driver.core.Session session
protected transient Throwable exception
protected transient com.google.common.util.concurrent.FutureCallback<V> callback
protected CassandraSinkBase(ClusterBuilder builder)
public void open(Configuration configuration)
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
configuration
- The configuration containing the parameters attached to the contract.Configuration
public void invoke(IN value) throws Exception
SinkFunction
invoke
in interface SinkFunction<IN>
invoke
in class RichSinkFunction<IN>
value
- The input record.Exception
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.