Skip to content

Commit

Permalink
[FLINK-7415] [cassandra] Add example instructions for creating keyspace
Browse files Browse the repository at this point in the history
This closes apache#4519.
  • Loading branch information
yew1eb authored and zentol committed Aug 15, 2017
1 parent 9eeb5b2 commit 5f97ac9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
/**
* This is an example showing the to use the Cassandra Input-/OutputFormats in the Batch API.
*
* <p>The example assumes that a table exists in a local cassandra database, according to the following query:
* CREATE TABLE test.batches (number int, strings text, PRIMARY KEY(number, strings));
* <p>The example assumes that a table exists in a local cassandra database, according to the following queries:
* CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': ‘1’};
* CREATE TABLE IF NOT EXISTS test.batches (number int, strings text, PRIMARY KEY(number, strings));
*/
public class BatchExample {
private static final String INSERT_QUERY = "INSERT INTO test.batches (number, strings) VALUES (?,?);";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
*
* <p>Pojo's have to be annotated with datastax annotations to work with this sink.
*
* <p>The example assumes that a table exists in a local cassandra database, according to the following query:
* <p>The example assumes that a table exists in a local cassandra database, according to the following queries:
* CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': ‘1’};
* CREATE TABLE IF NOT EXISTS test.message(body txt PRIMARY KEY)
*/
public class CassandraPojoSinkExample {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
/**
* This is an example showing the to use the Tuple Cassandra Sink in the Streaming API.
*
* <p>The example assumes that a table exists in a local cassandra database, according to the following query:
* <p>The example assumes that a table exists in a local cassandra database, according to the following queries:
* CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': ‘1’};
* CREATE TABLE IF NOT EXISTS test.writetuple(element1 text PRIMARY KEY, element2 int)
*/
public class CassandraTupleSinkExample {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
/**
* This is an example showing the to use the Cassandra Sink (with write-ahead log) in the Streaming API.
*
* <p>The example assumes that a table exists in a local cassandra database, according to the following query:
* <p>The example assumes that a table exists in a local cassandra database, according to the following queries:
* CREATE KEYSPACE IF NOT EXISTS example WITH replication = {'class': 'SimpleStrategy', 'replication_factor': ‘1’};
* CREATE TABLE example.values (id text, count int, PRIMARY KEY(id));
*
* <p>Important things to note are that checkpointing is enabled, a StateBackend is set and the enableWriteAheadLog() call
Expand Down

0 comments on commit 5f97ac9

Please sign in to comment.