Hbase/HowToContribute

How to Contribute to HBase

This page describes the mechanics of how to contribute software to HBase. For ideas about what you might contribute, please see the open issues in the [WWW] Hbase JIRA.

Getting the source code

First of all, you need the Hadoop source code.

Get the source code on your local drive using [WWW] SVN. Most development is done on the "trunk":

svn co http://svn.apache.org/repos/asf/hadoop/hbase/trunk hbase-core-trunk

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

Making Changes

Before you start, send a message to the <hbase-dev AT SPAMFREE hadoop DOT apache DOT org> HBase developer mailing list, or file a bug report in [WWW] Hbase 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.

But take care about the following points

Eclipse is your friend

If you use Eclipse, it can help you find problems before you submit your patch. Here's some configuration tips:

Open Window->Preferences... and open Java->Compiler

If you can make all the yellow bars at the right of your editor pane disappear, you have very well-formed Java code.

Generating a patch

Unit Tests

Please make sure that all unit tests succeed before constructing your patch and that no new javac compiler warnings are introduced by your patch.

> cd hadoop-trunk
> ant -Djavac.args="-Xlint -Xmaxwarns 1000" clean test tar

After a while, if you see

BUILD SUCCESSFUL

all is ok, but if you see

BUILD FAILED

then please examine error messages in build/test and fix things before proceeding.

Javadoc

Please also check the javadoc.

> ant javadoc
> firefox build/docs/api/index.html

Examine all public classes you've changed to see that documentation is complete and informative. Your patch must not generate any javadoc warnings.

Creating a patch

Check to see what files you have modified with:

svn stat

Add any new files with:

svn add src/.../MyNewClass.java

Edit the CHANGES.txt file, adding a description of your change, including the bug number it fixes. If this is a new feature, or other enhancement that doesn't currently have a ticket please create one for it, then use it's number when adding your note to CHANGES.txt. You'll need this ticket to submit your patch anyway.

In order to create a patch, just type:

svn diff > myBeautifulPatch.patch

This will report all modifications done on Hadoop sources on your local disk and save them into the myBeautifulPath.patch file. Read the patch file. Make sure it includes ONLY the modifications required to fix a single issue.

Please do not:

Please do:

Applying a patch

To apply a patch either you generated or found from JIRA, you can issue

patch -p0 <cool_patch.patch

if you just want to check whether the patch applies you can run patch with --dry-run option

patch -p0 --dry-run <cool_patch.patch

If you are an Eclipse user, you can apply a patch by : 1. Right click project name in Package Explorer , 2. Team -> Apply Patch

Contributing your work

Finally, patches should be attached to a bug report in [WWW] HBase JIRA via the Attach File link on the jira. Please add a comment that asks for a code review following our code review checklist. Please note that the attachment should be granted license to ASF for inclusion in ASF works (as per the [WWW] Apache License ยง5).

When you believe that your patch is ready to be committed, select the 'Submit Patch' link from the 'Available Workflow Actions' section in Jira. Submitted patches will be automatically tested against "trunk" by [WWW] Hudson, the project's continuous integration engine. Upon test completion, Hudson will add a success ("+1") message or failure ("-1") to your bug report in Jira. If your issue contains multiple patch versions, Hudson tests the last patch uploaded.

Folks should run 'ant clean test javadoc before selecting 'Submit Patch'. Tests should all pass. Javadoc should report no warnings or errors. Hudson's tests should only double-check things, and not be used as a primary patch tester, which would create too much noise on the mailing list and in Jira. Submitting patches that fail Hudson testing is frowned on, (unless the failure is not actually due to the patch).

If your patch involves performance optimizations, they should be validated by benchmarks that demonstrate an improvement.

Once a "+1" comment is received from the automated patch testing system and a "+1, code reviewed" comment is received from a code reviewer, a committer should then evaluate it within a few days and either: commit it; or reject it with an explanation.

Please be patient. Committers are busy people too. If no one responds to your patch after a few days, please make friendly reminders. Please incorporate other's suggestions into into your patch if you think they're reasonable. Finally, remember that even a patch that is not committed is useful to the community.

Should your patch earn a -1 on the Hudson test, set the issue status to 'Resume Progress', upload a patch with necessary fixes and then set the status to 'Submit Patch' again.

Committers: for non-trivial changes, it is required to get another committer to review your patches before commit. Use "Submit Patch" like other contributors, and then wait for a "+1" from another committer before committing. Please also try to frequently review things in the patch queue.

Jira Guidelines

Please comment on issues in Jira, making their concerns known. Please also vote for issues that are a high priority for you.

Please refrain from editing descriptions and comments if possible, as edits spam the mailing list and clutter Jira's "All" display, which is otherwise very useful. Instead, preview descriptions and comments using the preview button (on the right) before posting them. Keep descriptions brief and save more elaborate proposals for comments, since descriptions are included in Jira's automatically sent messages. If you change your mind, note this in a new comment, rather than editing an older comment. The issue should preserve this history of the discussion.

Stay involved

Contributors should join the developer's mailing list <hbase-dev AT SPAMFREE hadoop DOT apache DOT org>, the user's mailing list <hbase-user AT SPAMFREE hadoop DOT apache DOT org> and the commit's mailing list <hbase-commits AT SPAMFREE hadoop DOT apache DOT org>.

See Also

last edited 2008-03-04 19:38:49 by annndylee