Package x.data.cassandra
Class ScenarioKeyspaces
java.lang.Object
x.data.cassandra.ScenarioKeyspaces
Before running this Java (v2) code example, set up your development
environment, including your credentials.
For more information, see the following documentation topic:
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
Before running this Java code example, you must create a
Java keystore (JKS) file and place it in your project's resources folder.
This file is a secure file format used to hold certificate information for
Java applications. This is required to make a connection to Amazon Keyspaces.
For more information, see the following documentation topic:
https://docs.aws.amazon.com/keyspaces/latest/devguide/using_java_driver.html
This Java example performs the following tasks:
1. Create a keyspace.
2. Check for keyspace existence.
3. List keyspaces using a paginator.
4. Create a table with a simple movie data schema and enable point-in-time
recovery.
5. Check for the table to be in an Active state.
6. List all tables in the keyspace.
7. Use a Cassandra driver to insert some records into the Movie table.
8. Get all records from the Movie table.
9. Get a specific Movie.
10. Get a UTC timestamp for the current time.
11. Update the table schema to add a ‘watched’ Boolean column.
12. Update an item as watched.
13. Query for items with watched = True.
14. Restore the table back to the previous state using the timestamp.
15. Check for completion of the restore action.
16. Delete the table.
17. Confirm that both tables are deleted.
18. Delete the keyspace.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ScenarioKeyspaces
public ScenarioKeyspaces()
-