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);
            tbl.onStart();
        }

        // replay the log if necessary
        RecoveryManager.doRecovery();

        // start server internals
        StorageService.instance().initServer();

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

https://c.statcounter.com/9397521/0/fe557aad/1/|stats

  • No labels