incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zach Richardson <j.zach.richard...@gmail.com>
Subject Trying to write tests for CASSANDRA-3127 (Internode Compression)
Date Fri, 21 Oct 2011 21:28:23 GMT
Hi All,

I have been working on an implementation for internode compression
(CASSANDRA-3127.) https://issues.apache.org/jira/browse/CASSANDRA-3127

I have written code that "works," but I'm looking for some advice on
how to write unit tests for it.  At the moment it compresses where:

interrnode_message_compression_threshold > 0 means it compress
messages larger than it
compresses all messags if it is == 0
and compresses none if less than 0

The code itself has been tested in an environment outside of cassandra
(i.e. a few mock classes, and a heavily modified OutboundTcpConnection
and IncomingTcpConnection.) and inside of Cassandra all of the current
unit tests are passing.

Since I can't inject a mocked MessagingService into
IncomingTcpConnection, I'm guessing I have to do the testing from the
outside of MessagingService, but the MessagingService itself checks to
see if you are sending messages to yourself, and doesn't put them over
the connection.  Are there any tricks to letting me mock different
endpoints from within a unit test?

Can this only be tested in a distributed fashion at the OS level?

Also the internode_message_compression_threshold is set through the
cassandra.yaml file--is it possible to set these properties at
runtime?  Can I just change the public entry for it in the static
Config class directly, or will that break other things?

Thanks for you help and time,

Zach

Mime
View raw message