Class CassandraTupleOutputFormat<OUT extends org.apache.flink.api.java.tuple.Tuple>

  • Type Parameters:
    OUT - Type of Tuple 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 Flink Tuples into a Cassandra cluster. Please read the recommendations in CassandraOutputFormatBase.
    See Also:
    Serialized Form
    • Field Detail

      • session

        protected transient com.datastax.driver.core.Session session
    • Constructor Detail

      • CassandraTupleOutputFormat

        public CassandraTupleOutputFormat​(String insertQuery,
                                          ClusterBuilder builder)
      • CassandraTupleOutputFormat

        public CassandraTupleOutputFormat​(String insertQuery,
                                          ClusterBuilder builder,
                                          int maxConcurrentRequests,
                                          java.time.Duration maxConcurrentRequestsTimeout)
    • Method Detail

      • extractFields

        protected Object[] extractFields​(OUT 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 class org.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 class org.apache.flink.api.common.io.OutputFormatBase<OUT,​V>
      • listenableFutureToCompletableFuture

        protected static <T> CompletableFuture<T> listenableFutureToCompletableFuture​(com.google.common.util.concurrent.ListenableFuture<T> listenableFuture)