Cassandra Keysapce and Column Family Operations
Introduction
This sample creates a keyspace with a column family and inserts a given number of rows with random data. It demonstrates how to insert random data into user-specified keyspace, column family and columns.
Prerequisites
- Java Development Kit / JRE version 1.6.* or 1.7.*
- Apache Maven 3.x.x or later
Building the Sample
You can find the sample discussed here in $CARBON_HOME/samples/css/CLI/css-hector-sample directory.
1. Install and run the WSO2 Storage Server. Refer to the Installation Guide for instructions.
2. In a command prompt, switch to the sample directory:
For example, cd <AS_HOME>\samples\HelloWorldWebapp .
3. From there, execute the following command to build the project with Maven.
Â
mvn clean install
 Optionally, you can build the project with dependency libraries using following maven build command.
mvn clean assembly:assembly -o
4. Execute the program from the build jar which is located under target folder
java -jar target/org.wso2.carbon.cassandra.examples-4.0.5-jar-with-dependencies.jar
Executing the Sample
Execute the program using the following command.
java -jar target/org.wso2.carbon.cassandra.examples-4.0.5-jar-with-dependencies.jar