incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Łukasz Dywicki <>
Subject Re: Configuration of network connectors
Date Tue, 09 Jul 2013 18:05:32 GMT
Sadly it does not cover our case. We have unit tests and we want to test really basic things
like mappings of data contained in cassandra to our model. For that we don't need cluster
at all because in unit tests we don't want to test data distribution. We also would like to
run everything in JVM, thus CCM written in Python is not really what we need.
What we are looking for is minimal cassandra set up which could be embedded and used concurrently
multiple times. For example we now use CassandraUnit:

public CassandraUnit unit = new CassandraUnit(new EmptyDataSet(), "embedded-cassandra.yaml");

public void fistTest() {
// do something with data

public void secondTest() {
// do something else

In this set up JUnit will launch new CassandraDaemon for every test. If we set FORK_MODE per
test then we may have two cassandra instances running at the same time. First test which launch
CassandraDaemon will pass, second may fail due port usage conflict. That's why we thought
about testing without network layer. This can save some time. It would be great because for
some older hardware used by our developers it takes up to 9 minutes to run build with all
unit tests. Some of this time is consumed by startup and shutdown of cassandra.

Łukasz Dywicki
Twitter: ldywicki
Code-House -

Wiadomość napisana przez Jeremy Hanna <> w dniu 9 lip 2013,
o godz. 15:22:

> Have you seen as described in
or does that not fit your use case?
> On 9 Jul 2013, at 14:02, Łukasz Dywicki <> wrote:
>> Hello,
>> First of all I would like to say hello to cassandra user and developer community.
>> I write because we are using Cassandra in our unit tests and we have some troubles
with network connectivity. We ca not run multiple cassandra instances during tests because
we would need to randomize configuration of port and so on. For now if we try to fork our
tests we get "address already in use" on one from two ports - native or thrift. In other apache
projects we can "VM" connectors (ActiveMQ, Camel, Mina) based on in-memory queue. I took some
time to see how CassandraDaemon starts servers and it's kinda of hardcoded. I thought about
changing configuration to be more like:
>> servers:
>> - class org.apache.cassandra.thrift.ThriftServer
>> - class org.apache.cassandra.transport.Server
>> Then we will be able to disable these servers for unit tests:
>> servers:
>> - class org.apache.cassandra.vm.VmServer
>> This requires some small changes in daemon code and client libraries. I'm not really
deeply involved in cassandra stuff so I don't know the internal architecture and implications
thus I look forward for you to discuss this topic.
>> Cheers,
>> Łukasz Dywicki
>> --
>> Twitter: ldywicki
>> Blog:
>> Code-House -

View raw message