Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In particular, JAVA_HOME, IMPALA_HOME, IMPALA_HADOOP_VERSION, PYTHON_PATH, and LBLD_LIBRARY_PATH must be set properly.

...

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:

  • -XX:MaxPermSize=512mXms512m, -Xms512m, -Xmx4gXmx4g

Eclipse Launch Script

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

Java Frontend (FE)

The FE is a maven project which integrates very nicely with Eclipse. Follow these steps:

...

  1. 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.

    Info

    If you have already installed "Eclipse for Java Developers" or other Eclipse packages, you could install the CDT plug-in as follows:
    Launch Eclipse ⇒ Help ⇒ Install New Software ⇒ In "Work with" field, pull down the drop-down menu and select "Kepler - http://download.eclipse.org/releases/kepler" (or juno for Eclipse 4.2; or helios for Eclipse 3.7).
    In "Name" box, expand "Programming Language" node ⇒ Check "C/C++ Development Tools" ⇒ "Next" ⇒ ... ⇒ "Finish".


  2. Make sure you have generated the Impala Makefile via CMake. In $IMPALA_HOME run "cmake ."
  3. Import the BE project. In Eclipse go to File->Import->C/C++->Existing Code as Makefile Project. Navigate to $IMPALA_HOME/be. Select the "Linux GCC" toolchain.
  4. Set the Include Paths for the project. In Eclipse right-click the BE and go to Properties->C/C++ General->Paths and Symbols. Select GNU-C++ and click on "Import Settings". Import this include settings file. Note: the included xml is very obsolete. I use this script to create fresher ones: gen_eclipse_imports.py
    1. If for some reason the above steps did not work, you can manually add the includes via Properties->C/C++ General->Paths and Symbols. You can look in $IMPALA_HOME/be/CMakeFiles/CMakeDirectoryInformation.cmake for the exact includes you need.
  5. Rebuild the C++ index to resolve the includes. Project->C/C++ Index->Rebuild. After this step you shouldn't see any undefined macros and/or types anymore.

...

  1. Ensure proper ptrace settings. On Ubuntu edit /etc/sysctl.d/10-ptrace.conf and set kernel.yama.ptrace_scope = 0.
  2. Ensure appropriate .gdbinit in your home directory. It must contain at least the following two lines:

    Code Block
    handle SIGSEGV nostop noprint pass
    handle SIGPIPE nostop noprint pass


  3. In Eclipse go to Run->Debug Configurations->C/C++ Attach To Application. Use "build/debug/service/impalad" as the application and your BE project.
  4. At the bottom of this menu, click on "Select other..." to switch the "Attach to Process Launcher".
    1. The default GDB DSF launcher does not workwith Impala.
    2. Enable "Use Configuration Specific Settings" and select the Standard Attach To Process Launcher. Click OK.
  5. On the "Debug" panel of the debug configuration, select the gdb/mi debugger.
    1. As "GDB Command Set" use Standard (Linux)
    2. As "Protocol" use mi/2

      Note

      If GDB of impala toolchain cause errors,  you main try use system GDB. At "GDB debugger" use /usr/bin/gdb


  6. When you click "Debug" a menu will pop up listing the processes you can attach to. Search for "impalad" and select the one you want to debug.

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 

Python Tests

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:

...

  • In Eclipse go to Run->Debug Configurations. Select "Python unittest".
  • Select "tests" as the project and query_test/test_explain.py as the "Main Module".
  • In the arguments tab, enable "Override PyUnit preference for this launch?". Select the the Py.test runner.
  • Remove the default "–verbosity 0" argument (if present).
  • Add an environment variable “LD_LIBRARY_PATH” (via the tab of ENVIRONMENT, then add a new environment variable by clicking on the New button) and then put the following value: “$IMPALA_HOME/toolchain/cdh_components-1009254/kudu-1.10.0-cdh6.x-SNAPSHOT/debug/lib”.
  • Debug!

Combined FE/BE Debugging

...