Check if someone else has already begun work on the change you have in mind in the issue tracker
- If not, create a ticket describing the change you're proposing in the issue tracker
- Check out the latest version of the source code
svn checkout http://svn.apache.org/repos/asf/incubator/cassandra/trunk cassandra-trunk
- Modify the source to include the improvement/bugfix
Verify that you follow Cassandra's CodeStyle.
- Verify that your change works by adding a unit test.
- Make sure all tests pass by running "ant test" in the project directory.
- When you're happy with the result create a patch:
svn add <any new file>
svn diff > CASSANDRA-issuenumber.patch
- Attach the newly generated patch to the issue and click "Submit patch" in the left side of the JIRA page
- Wait for other developers or committers to review it and hopefully +1 the ticket
- Wait for a committer to commit it.
Testing and Coverage
Setting up and running system tests:
install python setuptools, if necessary (apt-get install python-setuptools)
easy_install nose
from trunk/interface/, run thrift -gen py cassandra.thrift
nosetests from trunk/
If you need to modify the system tests, you probably only need to care about test/system/test_server.py. (test/system/init.py takes care of spawning new cassandra instances for each test and cleaning up afterwards so they are isolated.)
Running the code coverage task:
Unzip this one: http://prdownloads.sourceforge.net/cobertura/cobertura-1.9.1-bin.zip?download
- ant codecoverage -Dcobertura.dir=/path/to/cobertura
- check build/cobertura
This is also available on Hudson (which updates about once every 24h) here: http://hudson.zones.apache.org/hudson/job/Cassandra/110/cobertura/
IDE
- IntelliJ Project Settings:
Main Class: org.apache.cassandra.service.CassandraDaemon
- VM Parameters: -ea -Xmx1G -Dstorage-config=conf -Dcassandra-foreground
Subversion Configuration
Add this to your subversion configuration (~/.subversion/config on unix-style installs) so that newly added files have the correct auto-properties once committed:
[auto-props] *.java = svn:eol-style=native *.properties = svn:eol-style=native *.py= svn:eol-style=native *.sh = svn:eol-style=native;svn:executable *.thrift = svn:eol-style=native *.txt = svn:eol-style=native *.xml = svn:eol-style=native *.jar = svn:mime-type=application/octet-stream *.bat = svn:eol-style=CRLF
Note: for this to work you must enable auto-props by setting enable-auto-props = yes in .subversion/config.
Got Git?
Using git to manage patches during reviews: http://spyced.blogspot.com/2009/06/patch-oriented-development-made-sane.html
Uploading and applying patches from JIRA automagically: GitAndJIRA
Playing nicely with others
- Try to keep patches that refactor or clean up existing code separate from patches that add functionality.