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> |
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> |
withConsistencyLevel(ValueProvider<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> |
withHosts(ValueProvider<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> |
withKeyspace(ValueProvider<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> |
withLocalDc(ValueProvider<java.lang.String> localDc)
Specify the local DC used for the load balancing.
|
CassandraIO.Read<T> |
withMapperFactoryFn(SerializableFunction<Session,Mapper> mapperFactory)
A factory to create a specific
Mapper for a given Cassandra Session. |
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> |
withMinNumberOfSplits(ValueProvider<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 used for authentication.
|
CassandraIO.Read<T> |
withPassword(ValueProvider<java.lang.String> password)
Specify the password used for authentication.
|
CassandraIO.Read<T> |
withPort(int port)
Specify the port number of the Apache Cassandra instances.
|
CassandraIO.Read<T> |
withPort(ValueProvider<java.lang.Integer> port)
Specify the port number of the Apache Cassandra instances.
|
CassandraIO.Read<T> |
withQuery(java.lang.String query)
Specify the query to read data.
|
CassandraIO.Read<T> |
withQuery(ValueProvider<java.lang.String> query)
Specify the query to read data.
|
CassandraIO.Read<T> |
withTable(java.lang.String table)
Specify the Cassandra table where to read data.
|
CassandraIO.Read<T> |
withTable(ValueProvider<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.
|
CassandraIO.Read<T> |
withUsername(ValueProvider<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> withHosts(ValueProvider<java.util.List<java.lang.String>> hosts)
public CassandraIO.Read<T> withPort(int port)
public CassandraIO.Read<T> withPort(ValueProvider<java.lang.Integer> port)
public CassandraIO.Read<T> withKeyspace(java.lang.String keyspace)
public CassandraIO.Read<T> withKeyspace(ValueProvider<java.lang.String> keyspace)
public CassandraIO.Read<T> withTable(java.lang.String table)
public CassandraIO.Read<T> withTable(ValueProvider<java.lang.String> table)
public CassandraIO.Read<T> withQuery(java.lang.String query)
public CassandraIO.Read<T> withQuery(ValueProvider<java.lang.String> query)
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> withUsername(ValueProvider<java.lang.String> username)
public CassandraIO.Read<T> withPassword(java.lang.String password)
public CassandraIO.Read<T> withPassword(ValueProvider<java.lang.String> password)
public CassandraIO.Read<T> withLocalDc(java.lang.String localDc)
public CassandraIO.Read<T> withLocalDc(ValueProvider<java.lang.String> localDc)
public CassandraIO.Read<T> withConsistencyLevel(java.lang.String consistencyLevel)
public CassandraIO.Read<T> withConsistencyLevel(ValueProvider<java.lang.String> consistencyLevel)
public CassandraIO.Read<T> withMinNumberOfSplits(java.lang.Integer minNumberOfSplits)
public CassandraIO.Read<T> withMinNumberOfSplits(ValueProvider<java.lang.Integer> minNumberOfSplits)
public CassandraIO.Read<T> withMapperFactoryFn(SerializableFunction<Session,Mapper> mapperFactory)
Mapper
for a given Cassandra Session. This is useful
to provide mappers that don't rely in Cassandra annotated objects.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>>