hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "ZooKeeper/HowToContribute" by PatrickHunt
Date Tue, 17 Feb 2009 21:17:54 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by PatrickHunt:

  svn checkout http://svn.apache.org/repos/asf/hadoop/zookeeper/trunk/ zookeeper-trunk
+ }}}
+ You may also want to develop against a specific release.  To do so, visit [http://svn.apache.org/repos/asf/hadoop/zookeeper/tags/]
and find the release that you are interested in developing against.  To checkout this release,
+ {{{
+ svn checkout http://svn.apache.org/repos/asf/hadoop/zookeeper/tags/release-X.Y.Z/ zookeeper-X.Y.Z
  If you prefer to use Eclipse for development, there are instructions for setting up SVN
access from within Eclipse at [:ZooKeeper/EclipseEnvironment: EclipseEnvironment].
@@ -35, +41 @@

    * 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}}})
+ ==== Understanding Ant ====
+ ZooKeeper is built by Ant, a Java building tool.  This section will eventually describe
how Ant is used within ZooKeeper.  To start, simply read a good Ant tutorial.  The following
is a good tutorial, though keep in mind that ZooKeeper isn't structured according to the ways
outlined in the tutorial.  Use the tutorial to get a basic understand of Ant but not to understand
how Ant is used for Hadoop:
+  * Good Ant tutorial: http://i-proving.ca/space/Technologies/Ant+Tutorial
  === Generating a patch ===
@@ -98, +110 @@

   * try to adhere to the coding style of files you edit;
   * comment code whose function or rationale is not obvious;
   * update documentation (e.g., ''package.html'' files, this wiki, etc.)
+  * name the patch file after the JIRA -- ZOOKEEPER-<JIRA#>.patch
  If you need to rename files in your patch:
   1. Write a shell script that uses 'svn mv' to rename the original files.
@@ -106, +119 @@

   1. Submit both the shell script and the patch file.
  This way other developers can preview your change by running the script and then applying
the patch.
+ ==== Testing your patch ====
+ Before submitting your patch, you are encouraged to run the same tools that the automated
Hudson system will run on your patch.  This enables you to fix problems with your patch before
you submit it.  The {{{test}}} Ant target will run your patch through the same checks that
Hudson currently does.
+ To use this target, you must run it from a clean workspace (ie {{{svn stat}}} shows no modifications
or additions).  From your clean workspace, run:
+ {{{
+ ant test
+ }}}
+ At the end, you should get a message on your console that indicates success.
+ Some things to note:
+  * you may need to explicitly set ANT_HOME.  Running {{{ant -diagnostics}}} will tell you
the default value on your system.
+  * you may need to explicitly set JAVA_HOME.
  ==== Applying a patch ====
  To apply a patch either you generated or found from JIRA, you can issue 
- patch -p0 < cool_patch.patch
+ patch -p0 < ZOOKEEPER-<JIRA#>.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
+ patch -p0 --dry-run < ZOOKEEPER-<JIRA#>.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 

View raw message