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 "HadoopUnderIDEA" by SteveLoughran
Date Fri, 27 Jun 2008 14:48:13 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 SteveLoughran:
http://wiki.apache.org/hadoop/HadoopUnderIDEA

The comment on the change is:
Page on working with Hadoop under IntelliJ IDEA

New page:
= Building/Testing Hadoop under IDEA =

Hadoop builds with Ant, but you can set it up to work under IDEA for testing and some iterative
development. This does not take away the need to run Ant; you just run it side by side.

== Before you begin ==
 * Be on Java6. That's where Hadoop is going.
 * Have the build work on the command line.

== Building ==

 * create and edit a build.properties file; add the line
{{{
build.webapps=build/resources/webapps
}}}

 * Do a command line build first, to set up all the output dirs

== Creating a new module ==
Create a new IDEA module for Hadoop.

=== Source folders ===

{{{
build/src
build/resources
conf
src/ant
src/contrib/streaming/src/java
src/core
src/examples
src/hdfs
src/mapred
src/native/src
src/tools
}}}
 * Even if you are not working on an area, adding it to the source tree makes refactoring
and class/method use queries more reliable.
 * Everything under {{{build/}}} goes away on a clean build, and needs to be picked up again
by resynchronizing IDEA (if it is not automatic)
 * By default, the webapp metadata goes into {{{build/webapps}}}, which is not the right place
to be picked up by the IDE. Moving it under {{{build/resources/}}} is needed to place it somewhere
manageable.

=== test source directories ===
{{{
src/test
}}}

Exclude stuff under there that you do not need.

=== Build Paths ===
Set these to the full path of where Hadoop's Ant build sticks things, such as :
 * output:  {{{/home/user/hadoop-core/build/classes}}}
 * Test output {{{/home/user/hadoop-core/build/test/classes}}}

=== Libraries ===
 * everything in the {{{lib/}}} directory.
 * If you have global libraries set up for Log4J, JUnit and Jetty (for example), use them
and omit the versions in {{{lib/}}}. Do keep in sync with library versions, especially that
of Jetty.


== Setting up a test run ==

To run JUnit tests under the IDE, create a new test configuration pointing to the chosen tests.
 * Use the classpath and JDK of the Hadoop module.
 * Select the package, class or method containing the chosen tests
 * VM Parameters: you must set up the logging directory
{{{
-Dhadoop.log.dir=/home/user/hadoop-core/build/test/logs
}}}
JRockit users: consider editing {{{conf/log4j.properties}}} to
{{{
log4j.appender.console.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
}}}

This may seem odd, but it eliminated deadlocks in the logging.

Mime
View raw message