s7/scale7-pelops

Add a new KeySpace hangs forever

rubendel opened this issue · 2 comments

The following code blocks at "keyspaceManager.addKeyspace(keyspaceDefinition);".

As I am also new to Cassandra, so I don't know for sure if this is a Pelops issue.

I am using Cassandra 0.7.0b1, and the latest GIT code for pelops.

    // Start embedded Cassandra 0.7.0b1
    System.setProperty("cassandra.config", "conf/cassandra.yaml");
    EmbeddedCassandraService embeddedCassandraService = new EmbeddedCassandraService();
    try {
        embeddedCassandraService.init();
    } catch (TTransportException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    Cluster cluster = new Cluster("localhost", 9160);
    KeyspaceManager keyspaceManager = Pelops.createKeyspaceManager(cluster);
    try {
        // Create new KeySpace
        KsDef keyspaceDefinition = new KsDef();
        keyspaceDefinition.setName("Main");
        keyspaceDefinition.setStrategy_class(KeyspaceManager.KSDEF_STRATEGY_RACK_UNAWARE);
        keyspaceDefinition.setReplication_factor(1);
        keyspaceDefinition.setCf_defs(new ArrayList<CfDef>());
        keyspaceManager.addKeyspace(keyspaceDefinition);
    } catch (Exception e1) {
        e1.printStackTrace();
    }

If this is not a bug, any help getting it to work is appreciated.

Seems to be working against a "real" instance of Cassandra. Can you use something like jstack to see where the thread is blocked?

Noticed your post on the Cassandra mailing list. Looks like it's an issue with the EmbeddedCassandraService so I'll close this issue.