Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/4696#discussion_r141612269 --- Diff: docs/dev/connectors/cassandra.md --- @@ -35,37 +43,47 @@ To use this connector, add the following dependency to your project: </dependency> {% endhighlight %} -Note that the streaming connectors are currently not part of the binary distribution. See how to link with them for cluster execution [here]({{ site.baseurl}}/dev/linking.html). +Note that the streaming connectors are currently __NOT__ part of the binary distribution. See how to link with them for cluster execution [here]({{ site.baseurl}}/dev/linking.html). + +## Installing Apache Cassandra +There are multiple ways to bring up a Cassandra instance on local machine: + +1. Follow the instructions from [Cassandra Getting Started page](http://cassandra.apache.org/doc/latest/getting_started/index.html). +2. Launch a container running Cassandra from [Official Docker Repository](https://hub.docker.com/_/cassandra/) -#### Installing Apache Cassandra -Follow the instructions from the [Cassandra Getting Started page](http://wiki.apache.org/cassandra/GettingStarted). +## Cassandra Sink +Flink Cassandra connector currently supports Apache Cassandra as a data sink. -#### Cassandra Sink +### Configurations Flink's Cassandra sink are created by using the static CassandraSink.addSink(DataStream<IN> input) method. -This method returns a CassandraSinkBuilder, which offers methods to further configure the sink. +This method returns a CassandraSinkBuilder, which offers methods to further configure the sink, and finally `build()` the sink instance. The following configuration methods can be used: -1. setQuery(String query) -2. setHost(String host[, int port]) -3. setClusterBuilder(ClusterBuilder builder) -4. enableWriteAheadLog([CheckpointCommitter committer]) -5. build() +1. _setQuery(String query)_ + * sets the upsert query that is executed for every record the sink receives. + * internally treated as CQL prepared statement, in which parameters could be shared or anonymous. + * __DO__ set the upsert query for processing __Tuple__ data type + * __DO NOT__ set the query for processing __POJO__ data type. +2. _setClusterBuilder()_ + * sets the cluster builder that is used to configure the connection to cassandra with more sophisticated settings such as consistency level, retry policy and etc. +3. _setHost(String host[, int port])_ + * simple version of setClusterBuilder() with host/port information to connect to Cassandra instances +4. _enableWriteAheadLog([CheckpointCommitter committer])_ + * an __optional__ setting + * allows exactly-once processing for non-deterministic algorithms. +5. _build()_ + * finalizes the configuration and constructs the CassandraSink instance. --- End diff -- finalizes -> Finalizes
---