You now want to contribute some codes to Apache Hadoop, surely there’s re something you might need to aware regarding to how to wrap your codes as a patch.
Open a JIRA
Assume you’re not working on a existing JIRA issue, you may need to open one before start coding stuff. You need a JIRA mainly because you need to document what you’re going to resolve and get some feedback and comments there, and also you need to name your patch, attach and submit your patch there too.
Code in the style
Make sure you’re writing the codes in right style. Check your codes by running:
Write necessary unit tests
You may need to add your own unit test cases, or at least you may need to make sure you’re not breaking the existing ones. Ref. Unit tests development guidelines HowToDevelopUnitTests
Run your unit test case
Assuming you add a unit test case named TestYourPatch.java, you can run it only without being mixed with others by:
mvn -Dtest=TestYourPatch test
Debug your unit test case
Your patch failed with a unit test case! So how to debug it? You can launch the right test case in debug mode as follows, then remote debug it using your IDE.
mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001" -Dtest=TestYourPatch test
Update the document
You may need to update doc either in API level or user guide part. Check doc by running:
Create a patch with the right name
Check the files list that should be included in your patch:
Get the right JIRA you’re working on and name your patch as:
Create the patch
svn diff > HADOOP-1234.patch
Test your patch
Attach your patch
Attach then your patch file to the JIRA, asking for code reviews.
Submit your patch
When you believe that your patch is ready to be committed, select the Submit Patch link on the issue’s Jira.
Note here’re just some quick points. May not enough so please read the official guide about HowToContribute when necessary.