Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

4/16/2021

Reading time:N/A min

nosan/embedded-cassandra

by nosan

Getting StartedEmbedded Cassandra provides an easy way to start and stop Apache Cassandra.To learn more about Embedded Cassandra, please consult the reference documentation.All versions of Embedded Cassandra reference documentation are here.Here is a quick teaser of starting Cassandra:import java.net.InetSocketAddress;import com.datastax.oss.driver.api.core.CqlSession;import com.github.nosan.embedded.cassandra.Cassandra;import com.github.nosan.embedded.cassandra.CassandraBuilder;import com.github.nosan.embedded.cassandra.Settings;import com.github.nosan.embedded.cassandra.cql.CqlScript;public class CassandraExamples { public static void main(String[] args) { Cassandra cassandra = new CassandraBuilder().build(); cassandra.start(); try { Settings settings = cassandra.getSettings(); try (CqlSession session = CqlSession.builder() .addContactPoint(new InetSocketAddress(settings.getAddress(), settings.getPort())) .withLocalDatacenter("datacenter1") .build()) { CqlScript.ofClassPath("schema.cql").forEachStatement(session::execute); } } finally { cassandra.stop(); } }}IssuesEmbedded Cassandra uses GitHub's issue tracking system to report bugs and feature requests. If you want to raise anissue, please follow this linkAlso see CONTRIBUTING.md if you wish to submit pull requests.BuildEmbedded Cassandra can be easily built with the maven wrapper. You also need JDK 1.8.LicenseEmbedded Cassandra is released under the Apache License 2.0Extensions

Illustration Image

Github CI codecov Maven Central Javadoc

Getting Started

Embedded Cassandra provides an easy way to start and stop Apache Cassandra.

To learn more about Embedded Cassandra, please consult the reference documentation.

All versions of Embedded Cassandra reference documentation are here.

Here is a quick teaser of starting Cassandra:

import java.net.InetSocketAddress;
import com.datastax.oss.driver.api.core.CqlSession;
import com.github.nosan.embedded.cassandra.Cassandra;
import com.github.nosan.embedded.cassandra.CassandraBuilder;
import com.github.nosan.embedded.cassandra.Settings;
import com.github.nosan.embedded.cassandra.cql.CqlScript;
public class CassandraExamples {
	public static void main(String[] args) {
		Cassandra cassandra = new CassandraBuilder().build();
		cassandra.start();
		try {
			Settings settings = cassandra.getSettings();
			try (CqlSession session = CqlSession.builder()
					.addContactPoint(new InetSocketAddress(settings.getAddress(), settings.getPort()))
					.withLocalDatacenter("datacenter1")
					.build()) {
				CqlScript.ofClassPath("schema.cql").forEachStatement(session::execute);
			}
		}
		finally {
			cassandra.stop();
		}
	}
}

Issues

Embedded Cassandra uses GitHub's issue tracking system to report bugs and feature requests. If you want to raise an issue, please follow this link

Also see CONTRIBUTING.md if you wish to submit pull requests.

Build

Embedded Cassandra can be easily built with the maven wrapper. You also need JDK 1.8.

License

Embedded Cassandra is released under the Apache License 2.0

Extensions


Buy Me A Coffee

Related Articles

cluster
troubleshooting
datastax

GitHub - arodrime/Montecristo: Datastax Cluster Health Check Tooling

arodrime

4/3/2024

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra