> For the complete documentation index, see [llms.txt](https://gejing.gitbook.io/101-building-modern-distributed-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gejing.gitbook.io/101-building-modern-distributed-platform/101-getting-started-with-flink-development/debug-flink-itcase.md).

# Debug Flink ITCase

{% hint style="info" %}
GitHub repo: <https://github.com/JingGe/101>
{% endhint %}

Most of the Flink ITCase can be run as same as the normal unit test, you can therefore debug it in the IntelliJ IDEA. For some complicated ITCase, if it could not run in the IDEA, you can consider setting up the remote debugging.

In this section we will use the real ITCase HBaseConnectorITCase as the example, so you can use it in your daily development.

There 3 steps to get the remote debugging done:

## 1. Run ITCase with maven command line

Go to the root directory of Flink project and run:

> <mark style="color:blue;">**\<your\_dir>/flink/mvn test -Dtest=HBaseConnectorITCase -Dinclude\_hadoop\_aws -Dhadoop.version=2.8.3 -Dmaven.surefire.debug -pl flink-connectors/flink-connector-hbase-2.2**</mark>

Alternatively, you can also to the Flink sub module directory, flink-connector-hbase-2.2 in this case, and run:

> <mark style="color:blue;">**\<your\_dir>/flink/flink-connectors/flink-connector-hbase-2.2(FLINK-24753✔) ➭ mvn test -Dtest=HBaseConnectorITCase -Dinclude\_hadoop\_aws -Dhadoop.version=2.8.3 -Dmaven.surefire.debug**</mark>

you will see in the command line output:

> **Listening for transport dt\_socket at address: 5005**

Step 1 is done, let's move to step 2.

## 2. Set up remote debugging in IDEA

If you are not familiar with the remote debug setup in IntelliJ IDEA, please refer to <https://www.jetbrains.com/help/idea/tutorial-remote-debug.html#be0ec68f>

For this case, the setup will look like this:

![](/files/g6fsT6HeDX3h6jnLVmMJ)

Step 2 is done, let's move to step 3.

## 3. Set up break points and Start the debug

Now you can set up some break points in your class and start debug in the IDEA. You will see that the process in the command line will be moving forward:

> Listening for transport dt\_socket at address: 5005 Running&#x20;
>
> **org.apache.flink.connector.hbase2.HBaseConnectorITCase**&#x20;
>
> **Formatting using clusterid: testClusterID**

And in the IDEA, you will see the the process is paused at the break point, like this:

![](/files/EOhUNTboq5SDnNCoUy5M)

Now happy debugging!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gejing.gitbook.io/101-building-modern-distributed-platform/101-getting-started-with-flink-development/debug-flink-itcase.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
