One of the common questions I get from students and developers relates to IDEs and MapReduce. Â How you create a MapReduce project in Eclipse and debug it? Â I have created a short screencast showing you how.
Cloudera QuickStart VM
The Cloudera QuickStart VM lets developers get started with writing MapReduce code without having to worry about software installs and configuration. Â Everything is installed and ready to go. Â You can download the image type that corresponds to your preferred virtualization platform.
Eclipse is installed on the VM and there is a link on the desktop to start it.
MapReduce and Eclipse
You can run and debug MapReduce code in Eclipse just like any other Java program. Â There are a few differences between running MapReduce in a distributed cluster and in an IDE like Eclipse. Â When you run MapReduce code in Eclipse, Hadoop runs in a special mode called LocalJobRunner. Â All of the Hadoop daemons are run in a single JVM (Java Virtual Machine) instead of several different JVMs. Â Another difference is that all file paths default to local file paths and not HDFS file paths.
With those caveats in mind, you can start putting in your breakpoints and debug your MapReduce code like any other Java program.
If you want to clone the same Git project as I do in the screencast, you can find it here. Â From the terminal type in:
git clone firstname.lastname@example.org:eljefe6a/UnoExample.git
The project will be cloned to the current directory as a subdirectory.
Note that creating Eclipse projects manually is the easy way to get started. Â If you are going to have Hadoop as part of an automated build process, you will want to do this in Maven. Â In Maven, you can create Eclipse projects. Â This blog post tells you how. Â If you want to compile Hadoop from source using Eclipse, this blog post shows how.
Whether you want to start writing some MapReduce code or debug existing code, the QuickStart VM will help you do it quickly and easily. Â This screencast walks you through it and gets you coding on your favorite IDE.