Class CassandraPojoOutputFormat<OUT>

  • Type Parameters:
    OUT - type of outputClass
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.io.OutputFormat<OUT>

    public class CassandraPojoOutputFormat<OUT>
    extends org.apache.flink.api.common.io.OutputFormatBase<OUT,​V>
    OutputFormat to write data to Apache Cassandra and from a custom Cassandra annotated object. Please read the recommendations in CassandraOutputFormatBase.
    See Also:
    Serialized Form
    • Field Detail

      • session

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

      • CassandraPojoOutputFormat

        public CassandraPojoOutputFormat​(ClusterBuilder builder,
                                         Class<OUT> outputClass)
      • CassandraPojoOutputFormat

        public CassandraPojoOutputFormat​(ClusterBuilder builder,
                                         Class<OUT> outputClass,
                                         MapperOptions mapperOptions,
                                         int maxConcurrentRequests,
                                         java.time.Duration maxConcurrentRequestsTimeout)
    • Method Detail

      • postOpen

        protected void postOpen()
        Opens a Session to Cassandra and initializes the prepared statement.
      • send

        protected CompletionStage<Void> send​(OUT record)
        Specified by:
        send in class org.apache.flink.api.common.io.OutputFormatBase<OUT,​Void>
      • postClose

        protected void postClose()
        Closes all resources used.
      • configure

        public void configure​(org.apache.flink.configuration.Configuration parameters)
        Configure the connection to Cassandra.
      • listenableFutureToCompletableFuture

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