Skip to content

Commit aed1b43

Browse files
committed
Update Documentation
1 parent 9121d46 commit aed1b43

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

README.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,26 @@ To use this SDK, add the following dependency to your project:
2020

2121
### Usage
2222

23-
- Define a Bean in respect of the `cassandra-driver-mapping` rules. Those are described in the [referential documentation](https://docs.datastax.com/en/developer/java-driver/3.11/manual/object_mapper/creating/). As an example we leverage this bean and this table:
24-
```sql
25-
CREATE TABLE IF NOT EXISTS simpledata (
26-
id int,
27-
data text,
28-
PRIMARY KEY (id)
29-
);
30-
```
31-
32-
- Associated bean will be the class [`SimpleDataEntity`](#)
23+
Documentation is avalailable in [Awesome Astra](https://awesome-astra.github.io/docs/pages/tools/integration/apache-beam-google-dataflow/) with sample codes
3324

34-
```java
35-
@Table(name = "simpledata")
36-
public class SimpleDataEntity implements Serializable {
37-
38-
@PartitionKey
39-
protected int id;
40-
@Column
41-
protected String data;
42-
43-
//Constructor, Getters and setters
44-
}
45-
```
4625

26+
- Read Data From Astra
4727

48-
- Create a Pipeline to read data From Astra
4928
```java
50-
```
5129

30+
// LanguageCode is a sample Pojo
5231

53-
- Create a Pipeline to write data into Astra
54-
```java
32+
// LanguageCodeDaoMapperFactoryFn implements
33+
// SerializableFunction<CqlSession, AstraDbMapper<LanguageCode>>
5534

35+
AstraDbIO.Read<LanguageCode> read = AstraDbIO.<LanguageCode>read()
36+
.withToken(options.getAstraToken())
37+
.withKeyspace(options.getAstraKeyspace())
38+
.withSecureConnectBundle(scbZip)
39+
.withTable(options.getTable())
40+
.withCoder(SerializableCoder.of(LanguageCode.class))
41+
.withMapperFactoryFn(new LanguageCodeDaoMapperFactoryFn())
42+
.withEntity(LanguageCode.class))
5643
```
5744

5845

0 commit comments

Comments
 (0)