The sample creates a simple keyspace and table with a multi-threaded app, and throws data in based on threads and no. of records.
- Before you can run this sample, you must have the following :
- An Apache Cassandra cluster and networking access to it. Check out portal quickstart for Azure Managed Instance for Apache Cassandra.
- Java Development Kit (JDK) 1.8+
- On Ubuntu, run
apt-get install default-jdk
to install the JDK.
- On Ubuntu, run
- Be sure to set the JAVA_HOME environment variable to point to the folder where the JDK is installed.
- Download and install a Maven binary archive
- On Ubuntu, you can run
apt-get install maven
to install Maven.
- On Ubuntu, you can run
- Git
- On Ubuntu, you can run
sudo apt-get install git
to install Git.
- On Ubuntu, you can run
- Update cassandra-related parameters, and number of threads/records to load, in
java-exmple/src/main/resources/application.conf
. - Run
mvn clean package
from java-examples folder to build the project. This will generate cassandra-mi-load-tester-1.0.0-SNAPSHOT.jar under target folder. - Run java -jar target/cassandra-mi-load-tester-1.0.0-SNAPSHOT.jar in a terminal to start your java application. This will create a keyspace and user table, and then run a load test with many concurrent threads.