org.apache.cassandra.service
Class EmbeddedCassandraService

java.lang.Object
  extended by org.apache.cassandra.service.EmbeddedCassandraService
All Implemented Interfaces:
java.lang.Runnable

public class EmbeddedCassandraService
extends java.lang.Object
implements java.lang.Runnable

An embedded, in-memory cassandra storage service that listens on the thrift interface as configured in cassandra.yaml This kind of service is useful when running unit tests of services using cassandra for example. See EmbeddedCassandraServiceTest for usage.

This is the implementation of https://issues.apache.org/jira/browse/CASSANDRA-740

How to use: In the client code create a new thread and spawn it with its Thread.start() method. Example:


        cassandra = new EmbeddedCassandraService();
        cassandra.init();

        // spawn cassandra in a new thread
        Thread t = new Thread(cassandra);
        t.setDaemon(true);
        t.start();

 

Author:
Ran Tavory ([email protected])

Constructor Summary
EmbeddedCassandraService()
           
 
Method Summary
 void init()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedCassandraService

public EmbeddedCassandraService()
Method Detail

init

public void init()
          throws org.apache.thrift.transport.TTransportException,
                 java.io.IOException
Throws:
org.apache.thrift.transport.TTransportException
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2011 The Apache Software Foundation