Package org.apache.beam.sdk.io.cassandra
Class CassandraIO.Read<T>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PBegin,PCollection<T>>
org.apache.beam.sdk.io.cassandra.CassandraIO.Read<T>
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Enclosing class:
CassandraIO
A
PTransform
to read data from Apache Cassandra. See CassandraIO
for more
information on usage and configuration.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverride this method to specify how thisPTransform
should be expanded on the givenInputT
.Specify theCoder
used to serialize the entity in thePCollection
.withConnectTimeout
(Integer timeout) Specify the Cassandra client connect timeout in ms.withConnectTimeout
(ValueProvider<Integer> timeout) Specify the Cassandra client connect timeout in ms.withConsistencyLevel
(String consistencyLevel) Specify the consistency level for the request (e.g.withConsistencyLevel
(ValueProvider<String> consistencyLevel) Specify the consistency level for the request (e.g.withEntity
(Class<T> entity) Specify the entity class (annotated POJO).Specify the hosts of the Apache Cassandra instances.withHosts
(ValueProvider<List<String>> hosts) Specify the hosts of the Apache Cassandra instances.withKeyspace
(String keyspace) Specify the Cassandra keyspace where to read data.withKeyspace
(ValueProvider<String> keyspace) Specify the Cassandra keyspace where to read data.withLocalDc
(String localDc) Specify the local DC used for the load balancing.withLocalDc
(ValueProvider<String> localDc) Specify the local DC used for the load balancing.withMapperFactoryFn
(SerializableFunction<Session, Mapper> mapperFactory) A factory to create a specificMapper
for a given Cassandra Session.withMinNumberOfSplits
(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.withMinNumberOfSplits
(ValueProvider<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.withPassword
(String password) Specify the password used for authentication.withPassword
(ValueProvider<String> password) Specify the password used for authentication.withPort
(int port) Specify the port number of the Apache Cassandra instances.withPort
(ValueProvider<Integer> port) Specify the port number of the Apache Cassandra instances.Specify the query to read data.withQuery
(ValueProvider<String> query) Specify the query to read data.withReadTimeout
(Integer timeout) Specify the Cassandra client read timeout in ms.withReadTimeout
(ValueProvider<Integer> timeout) Specify the Cassandra client read timeout in ms.withRingRanges
(Set<RingRange> ringRange) withRingRanges
(ValueProvider<Set<RingRange>> ringRange) withSsl
(SSLOptions sslOptions) Optionally, specifySSLOptions
configuration to utilize SSL.withSsl
(ValueProvider<SSLOptions> sslOptions) Optionally, specifySSLOptions
configuration to utilize SSL.Specify the Cassandra table where to read data.withTable
(ValueProvider<String> table) Specify the Cassandra table where to read data.withUsername
(String username) Specify the username for authentication.withUsername
(ValueProvider<String> username) Specify the username for authentication.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
Read
public Read()
-
-
Method Details
-
withHosts
Specify the hosts of the Apache Cassandra instances. -
withHosts
Specify the hosts of the Apache Cassandra instances. -
withPort
Specify the port number of the Apache Cassandra instances. -
withPort
Specify the port number of the Apache Cassandra instances. -
withKeyspace
Specify the Cassandra keyspace where to read data. -
withKeyspace
Specify the Cassandra keyspace where to read data. -
withTable
Specify the Cassandra table where to read data. -
withTable
Specify the Cassandra table where to read data. -
withQuery
Specify the query to read data. -
withQuery
Specify the query to read data. -
withEntity
Specify the entity class (annotated POJO). TheCassandraIO
will read the data and convert the data as entity instances. ThePCollection
resulting from the read will contains entity elements. -
withCoder
Specify theCoder
used to serialize the entity in thePCollection
. -
withUsername
Specify the username for authentication. -
withUsername
Specify the username for authentication. -
withPassword
Specify the password used for authentication. -
withPassword
Specify the password used for authentication. -
withLocalDc
Specify the local DC used for the load balancing. -
withLocalDc
Specify the local DC used for the load balancing. -
withConsistencyLevel
Specify the consistency level for the request (e.g. ONE, LOCAL_ONE, LOCAL_QUORUM, etc). -
withConsistencyLevel
Specify the consistency level for the request (e.g. ONE, LOCAL_ONE, LOCAL_QUORUM, etc). -
withMinNumberOfSplits
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. This setting allows to enforce a minimum number of splits in case Beam cannot compute it correctly. -
withMinNumberOfSplits
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. This setting allows to enforce a minimum number of splits in case Beam cannot compute it correctly. -
withConnectTimeout
Specify the Cassandra client connect timeout in ms. See https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -
withConnectTimeout
Specify the Cassandra client connect timeout in ms. See https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setConnectTimeoutMillis-int- -
withReadTimeout
Specify the Cassandra client read timeout in ms. See https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -
withReadTimeout
Specify the Cassandra client read timeout in ms. See https://docs.datastax.com/en/drivers/java/3.8/com/datastax/driver/core/SocketOptions.html#setReadTimeoutMillis-int- -
withMapperFactoryFn
A factory to create a specificMapper
for a given Cassandra Session. This is useful to provide mappers that don't rely in Cassandra annotated objects. -
withRingRanges
-
withRingRanges
-
withSsl
Optionally, specifySSLOptions
configuration to utilize SSL. See https://docs.datastax.com/en/developer/java-driver/3.11/manual/ssl/#jsse-programmatic -
withSsl
Optionally, specifySSLOptions
configuration to utilize SSL. See https://docs.datastax.com/en/developer/java-driver/3.11/manual/ssl/#jsse-programmatic -
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
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 classPTransform<PBegin,
PCollection<T>>
-