Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added instructions on debugging java frontend code

...

  1. Navigate to the Run and Debug view (left side toolbar).
  2. Click the Gear icon to open the launch.json file or click the "create a launch.json file" link if that link is visible.
  3. Add the following configuration:

    Code Block
    {
      "type": "java",
      "name": "FE Test Attach",
      "request": "attach",
      "hostName": "localhost",
      "port": 8000,
      "projectName": "impala-frontend"
    }


  4. Follow the steps in Debugging front-end test to launch a JVM that will listen for a debugger connection before continuing.
  5. In VSCode, navigate to the Run and Debug view again and launch "FE Test Attach (fe)".

Remote Debug Frontend

The frontend JVM opens a port for remote debugging starting with port 30000 for coordinator 0 and incrementing by 1 for each coordinator (30001 for coordinator 1, 30002 for coordinator 2, etc).  Thus, the best way to debug the front end is to start a single node Impala cluster thus ensuring the frontend remote debugging port will be 30000.

Then, set up VSCode as follows:

  1. Navigate to the Run and Debug view (left side toolbar).
  2. Click the Gear icon to open the launch.json file or click the "create a launch.json file" link if that link is visible.
  3. Add the following configuration:

    Code Block
        {
          "type": "java",
          "name": "Coordinator 0 FE Debug",
          "request": "attach",
          "hostName": "localhost",
          "port": 30000,
          "projectName": "impala-frontend"
        }


  4. Set breakpoints as needed in the frontend java code.
  5. In the left-side activity bar, click "Run and Debug".
  6. Select "Coordinator 0 FE Debug" from the drop-down.
  7. Click the "Start Debugging" button.  When queries are submitted, code execution will pause on the breakpoints.

Using Dev Container (Developing Inside Docker Container)

...