Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page describes the mechanics of how to contribute software to ZooKeeper. For ideas about what you might contribute, please see the ZooKeeper/ ProjectSuggestions page.

Getting the source code

First of all, you need the ZooKeeper source code.<<BR>>

Get the source code on your local drive using http://hadoop.apache.org/zookeeper/version_control.html. SVN. Most development is done on the "trunk":

...

If you prefer to use Eclipse for development, there are instructions for setting up SVN access from within Eclipse at ZooKeeper/EclipseEnvironment.

Making Changes

Before you start, send a message to the http://hadoop.apache.org/zookeeper/mailing_lists.html ZooKeeper developer mailing list, or file a bug report in ZooKeeper/Jira. Describe your proposed changes and check that they fit in with what others are doing and have planned for the project. Be patient, it may take folks a while to understand your requirements.

Modify the source code and add some (very) nice features using your favorite IDE.<<BR>>

But take care about the following points

  • All public classes and methods should have informative http://java.sun.com/j2se/javadoc/writingdoccomments/. Javadoc comments.
    • Do not use @author tags.
  • Code should be formatted according to http://java.sun.com/docs/codeconv/ Sun's conventions, with these exceptions:
    • Indent four spaces per level, not two or six or eight, etc... four.
    • No tabs for indentation, spaces only
  • Contributions should pass existing unit tests.
  • New unit tests should be provided to demonstrate bugs and fixes. http://www.junit.org JUnit is our test framework:
    • You must implement a class that extends junit.framework.TestCase and whose class name ends with Test.
    • Define methods within your class whose names begin with test, and call JUnit's many assert methods to verify conditions; these methods will be executed when you run ant test.
    • By default, do not let tests write any temporary files to /tmp. Instead, the tests should write to the location specified by the test.build.data system property.
    • Place your class in the src/java/test tree.
    • ClientTest.java is an example of a client-server test.
    • You can run all the unit test with the command ant test, or you can run a specific unit test with the command ant -Dtestcase=<class name without package prefix> test (for example ant -Dtestcase=ClientTest test)

...

Finally, patches should be attached to an issue report in http://issues.apache.org/jira/browse/ZOOKEEPER Jira via the Attach File link on the issue's Jira. Please add a comment that asks for a code review following our CodeReviewChecklist code review checklist. Please note that the attachment should be granted license to ASF for inclusion in ASF works (as per the http://www.apache.org/licenses/LICENSE-2.0 Apache License §5).

When you believe that your patch is ready to be committed, select the Submit Patch link on the issue's Jira.

...

Contributors should join the http://hadoop.apache.org/zookeeper/mailing_lists.html ZooKeeper mailing lists. In particular, the commit list (to see changes as they are made), the dev list (to join discussions of changes) and the user list (to help others).

See Also