IN
- Type of the elements emitted by this sinkpublic class CassandraPojoSink<IN> extends CassandraSinkBase<IN,com.datastax.driver.core.ResultSet>
SinkFunction.Context<T>
Modifier and Type | Field and Description |
---|---|
protected Class<IN> |
clazz |
protected com.datastax.driver.mapping.Mapper<IN> |
mapper |
protected com.datastax.driver.mapping.MappingManager |
mappingManager |
Constructor and Description |
---|
CassandraPojoSink(Class<IN> clazz,
ClusterBuilder builder)
The main constructor for creating CassandraPojoSink.
|
CassandraPojoSink(Class<IN> clazz,
ClusterBuilder builder,
MapperOptions options) |
CassandraPojoSink(Class<IN> clazz,
ClusterBuilder builder,
MapperOptions options,
String keyspace) |
CassandraPojoSink(Class<IN> clazz,
ClusterBuilder builder,
String keyspace) |
Modifier and Type | Method and Description |
---|---|
protected com.datastax.driver.core.Session |
createSession() |
void |
open(Configuration configuration)
Initialization method for the function.
|
com.google.common.util.concurrent.ListenableFuture<com.datastax.driver.core.ResultSet> |
send(IN value) |
close, initializeState, invoke, snapshotState
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invoke
protected transient com.datastax.driver.mapping.Mapper<IN> mapper
protected transient com.datastax.driver.mapping.MappingManager mappingManager
public CassandraPojoSink(Class<IN> clazz, ClusterBuilder builder)
clazz
- Class instancepublic CassandraPojoSink(Class<IN> clazz, ClusterBuilder builder, @Nullable MapperOptions options)
public CassandraPojoSink(Class<IN> clazz, ClusterBuilder builder, String keyspace)
public CassandraPojoSink(Class<IN> clazz, ClusterBuilder builder, @Nullable MapperOptions options, String keyspace)
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 CassandraSinkBase<IN,com.datastax.driver.core.ResultSet>
configuration
- The configuration containing the parameters attached to the contract.Configuration
protected com.datastax.driver.core.Session createSession()
createSession
in class CassandraSinkBase<IN,com.datastax.driver.core.ResultSet>
public com.google.common.util.concurrent.ListenableFuture<com.datastax.driver.core.ResultSet> send(IN value)
send
in class CassandraSinkBase<IN,com.datastax.driver.core.ResultSet>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.