Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-8080

Provide support for running cassandra embedded

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Packaging
    • None

    Description

      EmbeddedCassandraService allows to run cassandra embedded. What's missing is a much more clear interface for running cassandra embedded in other applications.

      Running cassandra embedded should be much simpler an the user should be able to run it and configure it using only an API (no configuration file required).

      The user should be able to do something like:

      CassandraSever cassandra = Cassandra.newInstance(new File("cassandra.yaml"); //creates a cassandra node using a configuration file

      Or

      CassandraConfig config = new CassandraConfig().seeds("ip1", "ip2");
      CassandraServer cassandra = Cassandra.newInstance(config);

      Implementing this type of functionality should be simple since cassandra already converts the yaml file to a java class. Also there's a system property to change the cassandra configuration loader.

      It should also be possible to have a client that doesn't need to go through the wire to communicate with Cassandra, users should be able to do just:

      CassandraServer cassandra ...
      Session session = cassandra.createSession();
      session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s WITH replication =

      {'class':'SimpleStrategy', 'replication_factor':2}

      ;", applicationName));

      This seems to work using directly classes from the package: org.apache.cassandra.transport.messages

      One other thing, but this seems far more complex to do, is that it should be possible to create several cassandra nodes inside a single JVM. This would allow to do much more simpler test for cassandra functionality. The problem here is that cassandra code has too much static data.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pablolagreca Pablo La Greca
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: