Class CassandraSinkBase<IN,V>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.streaming.api.functions.sink.RichSinkFunction<IN>
-
- org.apache.flink.streaming.connectors.cassandra.CassandraSinkBase<IN,V>
-
- Type Parameters:
IN
- Type of the elements emitted by this sink
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.functions.Function
,org.apache.flink.api.common.functions.RichFunction
,org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
,org.apache.flink.streaming.api.functions.sink.SinkFunction<IN>
- Direct Known Subclasses:
AbstractCassandraTupleSink
,CassandraPojoSink
public abstract class CassandraSinkBase<IN,V> extends org.apache.flink.streaming.api.functions.sink.RichSinkFunction<IN> implements org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
CassandraSinkBase is the common abstract class ofCassandraPojoSink
andCassandraTupleSink
.In case of experiencing the following error:
Error while sending value. com.datastax.driver.core.exceptions.WriteTimeoutException: Cassandra timeout during write query at consistency LOCAL_ONE (1 replica were required but only 0 acknowledged the write)
,it is recommended to increase the Cassandra write timeout to adapt to your workload in your Cassandra cluster so that such timeout errors do not happen. For that you need to raise write_request_timeout_in_ms conf parameter in your cassandra.yml. Indeed, This exception means that Cassandra coordinator node (internal Cassandra) waited too long for an internal replication (replication to another node and did not ack the write. It is not recommended to lower the replication factor in your Cassandra cluster because it is mandatory that you do not loose data in case of a Cassandra cluster failure. Waiting for a single replica for write acknowledge is the minimum level for this guarantee in Cassandra.}
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
protected com.datastax.driver.core.Session
createSession()
void
initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context)
void
invoke(IN value)
void
open(org.apache.flink.configuration.Configuration configuration)
abstract com.google.common.util.concurrent.ListenableFuture<V>
send(IN value)
void
snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext ctx)
-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
-
-
-
-
Method Detail
-
open
public void open(org.apache.flink.configuration.Configuration configuration)
- Specified by:
open
in interfaceorg.apache.flink.api.common.functions.RichFunction
- Overrides:
open
in classorg.apache.flink.api.common.functions.AbstractRichFunction
-
close
public void close() throws Exception
- Specified by:
close
in interfaceorg.apache.flink.api.common.functions.RichFunction
- Overrides:
close
in classorg.apache.flink.api.common.functions.AbstractRichFunction
- Throws:
Exception
-
initializeState
public void initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) throws Exception
- Specified by:
initializeState
in interfaceorg.apache.flink.streaming.api.checkpoint.CheckpointedFunction
- Throws:
Exception
-
snapshotState
public void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext ctx) throws Exception
- Specified by:
snapshotState
in interfaceorg.apache.flink.streaming.api.checkpoint.CheckpointedFunction
- Throws:
Exception
-
createSession
protected com.datastax.driver.core.Session createSession()
-
-