This doc describes how to setup Eclipse for:
After this setup you will be able to debug the FE and BE simultaneously in Eclipse almost seamlessly.
For all steps below, you must have sourced $IMPALA_HOME/bin/impala-config.sh and $IMPALA_HOME/bin/set-classpath.sh.
In particular, JAVA_HOME, IMPALA_HOME, IMPALA_HADOOP_VERSION, PYTHON_PATH, and LD_LIBRARY_PATH must be set properly.
Get the tarball Eclipse IDE for Java Developers from the Eclipse homepage. The instructions in this doc have been confirmed to work with the version Kepler SR2.
Do not download "Eclipse Standard" or "Eclipse IDE for Java EE Developers". If you do so, you may see the the FE project not resolving dependencies correctly, auto-completion not working or other similar issues. Do not install Eclipse via apt-get or similar tools. These instructions might not work. Just get the tarball from the Eclipse homepage. |
For a good experience, it is recommended to allow Eclipse to use a good bit of memory. In your eclipse installation folder, open eclipse.ini and change the existing settings to the following recommended values:
In addition to the sourced scripts above, you must add a build path to LD_LIBRARY_PATH. Easiest is to create a script that does all this each time you start Eclipse. For example, we might create a script "ecl". (Adjust paths for your environment.)
#! /bin/bash
export IMPALA_HOME=$HOME/Impala
source $IMPALA_HOME/bin/impala-config.sh
source $IMPALA_HOME/bin/set-classpath.sh
export LD_LIBRARY_PATH=${IMPALA_HOME}/be/build/debug/service:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
exec eclipse/java-photon/eclipse/eclipse
The FE is a maven project which integrates very nicely with Eclipse. Follow these steps:
Do not use an Eclipse Maven Plugin (M2Eclipse or others) to set up your project. That route is very error prone. Attempt at your own risk. |
You can verify the import by trying to execute the planner tests in PlannerTest.java. This step requires a running Impala cluster.
Assuming you started an Impala cluster via $IMPALA_HOME/bin/start-impala-cluster.py you can attach the Java debugger with these steps:
The BE is a CMake project that can be manually integrated using the Eclipse CDT plugin. Follow these steps:
Install the Eclipse CDT plugin. In Eclipse go to Help->Install New Software. Add the CDT download site for your version of Eclipse (tested on Kepler). Follow instructions.
If you have already installed "Eclipse for Java Developers" or other Eclipse packages, you could install the CDT plug-in as follows: |
There are several methods for auto-discovering the BE include paths (e.g., based on CMake integration with Eclipse). I haven't found one that works. Just do it manually, trust me. |
Ensure appropriate .gdbinit in your home directory. It must contain at least the following two lines:
handle SIGSEGV nostop noprint pass handle SIGPIPE nostop noprint pass |
As "Protocol" use mi/2
If GDB of impala toolchain cause errors, you main try use system GDB. At "GDB debugger" use /usr/bin/gdb |
You may want to enable pretty printing in gdb as described here Eclipse Setup for Impala Development.
Note: the above is for Eclipse Juno. The described
To develop and debug Python in Eclipse I recommend the PyDev plugin. Follow these steps to setup Eclipse for developing/debugging most Impala Python components:
As an example, follow these instructions to debug the test query_test/test_explain.py in Eclipse:
If you followed the FE/BE debugging steps above, then you should have individual Eclipse Debug Configurations for the FE and BE.
You can create a launch group for starting those configurations simultaneously as follows.
If you are a vi/vim user there is a plugin which permits you to use vim keystrokes in the eclipse editor. In eclipse goto
Help > Install New Software... |
and enter the site:
http://vrapper.sourceforge.net/update-site/stable |
It will load for a bit, then select the Vrapper click box and continue. It will load for a bit and then ask if you want to restart. Do so. Documentation is here:
http://vrapper.sourceforge.net/documentation/?page=1 |