Class CassandraTupleOutputFormat<OUT extends org.apache.flink.api.java.tuple.Tuple>
- java.lang.Object
-
- org.apache.flink.api.common.io.RichOutputFormat<OUT>
-
- org.apache.flink.api.common.io.OutputFormatBase<OUT,V>
-
- org.apache.flink.batch.connectors.cassandra.CassandraTupleOutputFormat<OUT>
-
- Type Parameters:
OUT
- Type ofTuple
to write to Cassandra.
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.io.OutputFormat<OUT>
- Direct Known Subclasses:
CassandraOutputFormat
public class CassandraTupleOutputFormat<OUT extends org.apache.flink.api.java.tuple.Tuple> extends org.apache.flink.api.common.io.OutputFormatBase<OUT,V>
OutputFormat to write FlinkTuple
s into a Cassandra cluster. Please read the recommendations in CassandraOutputFormatBase.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.datastax.driver.core.Session
session
-
Constructor Summary
Constructors Constructor Description CassandraTupleOutputFormat(String insertQuery, ClusterBuilder builder)
CassandraTupleOutputFormat(String insertQuery, ClusterBuilder builder, int maxConcurrentRequests, java.time.Duration maxConcurrentRequestsTimeout)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(org.apache.flink.configuration.Configuration parameters)
Configure the connection to Cassandra.protected Object[]
extractFields(OUT record)
protected static <T> CompletableFuture<T>
listenableFutureToCompletableFuture(com.google.common.util.concurrent.ListenableFuture<T> listenableFuture)
protected void
postClose()
Closes all resources used by Cassandra connection.protected void
postOpen()
Opens a Session to Cassandra .protected CompletionStage<com.datastax.driver.core.ResultSet>
send(OUT record)
-
Methods inherited from class org.apache.flink.api.common.io.OutputFormatBase
close, open, writeRecord
-
-
-
-
Constructor Detail
-
CassandraTupleOutputFormat
public CassandraTupleOutputFormat(String insertQuery, ClusterBuilder builder)
-
CassandraTupleOutputFormat
public CassandraTupleOutputFormat(String insertQuery, ClusterBuilder builder, int maxConcurrentRequests, java.time.Duration maxConcurrentRequestsTimeout)
-
-
Method Detail
-
postOpen
protected void postOpen()
Opens a Session to Cassandra .
-
send
protected CompletionStage<com.datastax.driver.core.ResultSet> send(OUT record)
- Specified by:
send
in classorg.apache.flink.api.common.io.OutputFormatBase<OUT,com.datastax.driver.core.ResultSet>
-
configure
public void configure(org.apache.flink.configuration.Configuration parameters)
Configure the connection to Cassandra.
-
postClose
protected void postClose()
Closes all resources used by Cassandra connection.- Overrides:
postClose
in classorg.apache.flink.api.common.io.OutputFormatBase<OUT,V>
-
listenableFutureToCompletableFuture
protected static <T> CompletableFuture<T> listenableFutureToCompletableFuture(com.google.common.util.concurrent.ListenableFuture<T> listenableFuture)
-
-