Class 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 Flink Rows 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

      • 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 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)