WARNING: Cassandra's internal APIs should be considered highly volatile, even after a 1.0 release.

You can run a Cassandra node internal to your own JVM-based code easily. Here's what CassandraDaemon does:

        // initialize keyspaces
        for (String table : Table.getAllTableNames())
            if (logger.isDebugEnabled())
                logger.debug("opening keyspace " + table);
            Table tbl = Table.open(table);

        // replay the log if necessary

        // start server internals

Then you can use the internal StorageProxy API without going through Thrift.

A higher level embedded cassandra service is described here http://prettyprint.me/2010/02/14/running-cassandra-as-an-embedded-service/ and committed to trunk of v6


Embedding (last edited 2013-11-14 17:58:32 by 107)