Class CassandraRowOutputFormat
- 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.CassandraRowOutputFormat
-
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Row>
public class CassandraRowOutputFormat extends org.apache.flink.api.common.io.OutputFormatBase<OUT,V>
OutputFormat to write FlinkRow
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 CassandraRowOutputFormat(String insertQuery, ClusterBuilder builder)
CassandraRowOutputFormat(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(org.apache.flink.types.Row 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
-
CassandraRowOutputFormat
public CassandraRowOutputFormat(String insertQuery, ClusterBuilder builder)
-
CassandraRowOutputFormat
public CassandraRowOutputFormat(String insertQuery, ClusterBuilder builder, int maxConcurrentRequests, java.time.Duration maxConcurrentRequestsTimeout)
-
-
Method Detail
-
extractFields
protected Object[] extractFields(org.apache.flink.types.Row record)
-
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)
-
-