Apache Beam SDK to work with Astra Pipelines
To use this SDK, add the following dependency to your project:
<dependency>
<groupId>com.datastax.astra</groupId>
<artifactId>beam-sdks-java-io-astra</artifactId>
<version>${latest-version}</version>
</dependency>
Documentation is available in Awesome Astra with sample codes
- Read Data From Astra
// Get binary from File path
byte[] scbZip = AstraSecureConnectBundleUtils
.loadFromFilePath(options.getAstraSecureConnectBundle());
// Build a Source
AstraDbIO.Read<LanguageCode> read = AstraDbIO.<LanguageCode>read()
.withToken(options.getAstraToken())
.withKeyspace(options.getAstraKeyspace())
.withSecureConnectBundle(scbZip)
.withTable(options.getTable())
.withCoder(SerializableCoder.of(LanguageCode.class))
.withMapperFactoryFn(new LanguageCodeDaoMapperFactoryFn())
.withEntity(LanguageCode.class))