public abstract static class CassandraIO.Read<T> extends PTransform<PBegin,PCollection<T>>
PTransform
to read data from Apache Cassandra. See CassandraIO
for more
information on usage and configuration.name
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<T> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
CassandraIO.Read<T> |
withCassandraService(org.apache.beam.sdk.io.cassandra.CassandraService<T> cassandraService)
Specify an instance of
CassandraService used to connect and read from Cassandra
database. |
CassandraIO.Read<T> |
withCoder(Coder<T> coder)
Specify the
Coder used to serialize the entity in the PCollection . |
CassandraIO.Read<T> |
withConsistencyLevel(java.lang.String consistencyLevel) |
CassandraIO.Read<T> |
withEntity(java.lang.Class<T> entity)
Specify the entity class (annotated POJO).
|
CassandraIO.Read<T> |
withHosts(java.util.List<java.lang.String> hosts)
Specify the hosts of the Apache Cassandra instances.
|
CassandraIO.Read<T> |
withKeyspace(java.lang.String keyspace)
Specify the Cassandra keyspace where to read data.
|
CassandraIO.Read<T> |
withLocalDc(java.lang.String localDc)
Specify the local DC used for the load balancing.
|
CassandraIO.Read<T> |
withMinNumberOfSplits(java.lang.Integer minNumberOfSplits)
It's possible that system.size_estimates isn't populated or that the number of splits
computed by Beam is still to low for Cassandra to handle it.
|
CassandraIO.Read<T> |
withPassword(java.lang.String password)
Specify the password for authentication.
|
CassandraIO.Read<T> |
withPort(int port)
Specify the port number of the Apache Cassandra instances.
|
CassandraIO.Read<T> |
withTable(java.lang.String table)
Specify the Cassandra table where to read data.
|
CassandraIO.Read<T> |
withUsername(java.lang.String username)
Specify the username for authentication.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public CassandraIO.Read<T> withHosts(java.util.List<java.lang.String> hosts)
public CassandraIO.Read<T> withPort(int port)
public CassandraIO.Read<T> withKeyspace(java.lang.String keyspace)
public CassandraIO.Read<T> withTable(java.lang.String table)
public CassandraIO.Read<T> withEntity(java.lang.Class<T> entity)
CassandraIO
will read the data and
convert the data as entity instances. The PCollection
resulting from the read will
contains entity elements.public CassandraIO.Read<T> withCoder(Coder<T> coder)
Coder
used to serialize the entity in the PCollection
.public CassandraIO.Read<T> withUsername(java.lang.String username)
public CassandraIO.Read<T> withPassword(java.lang.String password)
public CassandraIO.Read<T> withLocalDc(java.lang.String localDc)
public CassandraIO.Read<T> withConsistencyLevel(java.lang.String consistencyLevel)
public CassandraIO.Read<T> withMinNumberOfSplits(java.lang.Integer minNumberOfSplits)
public CassandraIO.Read<T> withCassandraService(org.apache.beam.sdk.io.cassandra.CassandraService<T> cassandraService)
CassandraService
used to connect and read from Cassandra
database.public PCollection<T> expand(PBegin input)
PTransform
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).
expand
in class PTransform<PBegin,PCollection<T>>