Class CassandraIO.Write<T>

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<T>,PDone>
org.apache.beam.sdk.io.cassandra.CassandraIO.Write<T>
All Implemented Interfaces:
Serializable, HasDisplayData
Enclosing class:
CassandraIO

public abstract static class CassandraIO.Write<T> extends PTransform<PCollection<T>,PDone>
A PTransform to mutate into Apache Cassandra. See CassandraIO for details on usage and configuration.
See Also:
  • Constructor Details

    • Write

      public Write()
  • Method Details

    • withHosts

      public CassandraIO.Write<T> withHosts(List<String> hosts)
      Specify the Cassandra instance hosts where to write data.
    • withHosts

      public CassandraIO.Write<T> withHosts(ValueProvider<List<String>> hosts)
      Specify the hosts of the Apache Cassandra instances.
    • withPort

      public CassandraIO.Write<T> withPort(int port)
      Specify the Cassandra instance port number where to write data.
    • withPort

      public CassandraIO.Write<T> withPort(ValueProvider<Integer> port)
      Specify the port number of the Apache Cassandra instances.
    • withKeyspace

      public CassandraIO.Write<T> withKeyspace(String keyspace)
      Specify the Cassandra keyspace where to write data.
    • withKeyspace

      public CassandraIO.Write<T> withKeyspace(ValueProvider<String> keyspace)
      Specify the Cassandra keyspace where to read data.
    • withEntity

      public CassandraIO.Write<T> withEntity(Class<T> entity)
      Specify the entity class in the input PCollection. The CassandraIO will map this entity to the Cassandra table thanks to the annotations.
    • withUsername

      public CassandraIO.Write<T> withUsername(String username)
      Specify the username used for authentication.
    • withUsername

      public CassandraIO.Write<T> withUsername(ValueProvider<String> username)
      Specify the username for authentication.
    • withPassword

      public CassandraIO.Write<T> withPassword(String password)
      Specify the password used for authentication.
    • withPassword

      public CassandraIO.Write<T> withPassword(ValueProvider<String> password)
      Specify the password used for authentication.
    • withLocalDc

      public CassandraIO.Write<T> withLocalDc(String localDc)
      Specify the local DC used by the load balancing policy.
    • withLocalDc

      public CassandraIO.Write<T> withLocalDc(ValueProvider<String> localDc)
      Specify the local DC used for the load balancing.
    • withConsistencyLevel

      public CassandraIO.Write<T> withConsistencyLevel(String consistencyLevel)
      Specify the consistency level for the request (e.g. ONE, LOCAL_ONE, LOCAL_QUORUM, etc).
    • withConsistencyLevel

      public CassandraIO.Write<T> withConsistencyLevel(ValueProvider<String> consistencyLevel)
      Specify the consistency level for the request (e.g. ONE, LOCAL_ONE, LOCAL_QUORUM, etc).
    • withConnectTimeout

      public CassandraIO.Write<T> withConnectTimeout(Integer timeout)
      Cassandra client socket option for connect timeout in ms.
    • withConnectTimeout

      public CassandraIO.Write<T> withConnectTimeout(ValueProvider<Integer> timeout)
      Cassandra client socket option for connect timeout in ms.
    • withReadTimeout

      public CassandraIO.Write<T> withReadTimeout(Integer timeout)
      Cassandra client socket option to set the read timeout in ms.
    • withReadTimeout

      public CassandraIO.Write<T> withReadTimeout(ValueProvider<Integer> timeout)
      Cassandra client socket option to set the read timeout in ms.
    • withMapperFactoryFn

      public CassandraIO.Write<T> withMapperFactoryFn(SerializableFunction<Session,Mapper> mapperFactoryFn)
    • withSsl

      public CassandraIO.Write<T> withSsl(SSLOptions sslOptions)
      Optionally, specify SSLOptions configuration to utilize SSL. See https://docs.datastax.com/en/developer/java-driver/3.11/manual/ssl/#jsse-programmatic
    • withSsl

      public CassandraIO.Write<T> withSsl(ValueProvider<SSLOptions> sslOptions)
      Optionally, specify SSLOptions configuration to utilize SSL. See https://docs.datastax.com/en/developer/java-driver/3.11/manual/ssl/#jsse-programmatic
    • validate

      public void validate(PipelineOptions pipelineOptions)
      Description copied from class: PTransform
      Called before running the Pipeline to verify this transform is fully and correctly specified.

      By default, does nothing.

      Overrides:
      validate in class PTransform<PCollection<T>,PDone>
    • expand

      public PDone expand(PCollection<T> input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PCollection<T>,PDone>