Skip to content

[ZEPPELIN-6264] Refactor InfluxDBInterpreter for improved readability and maintainability#5005

Merged
Reamer merged 3 commits into
apache:masterfrom
eunhwa99:ZEPPELIN-6264
Aug 4, 2025
Merged

[ZEPPELIN-6264] Refactor InfluxDBInterpreter for improved readability and maintainability#5005
Reamer merged 3 commits into
apache:masterfrom
eunhwa99:ZEPPELIN-6264

Conversation

@eunhwa99

@eunhwa99 eunhwa99 commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

What is this PR for?

This PR refactors the InfluxDBInterpreter.class to improve code readability, maintainability, and adherence to modern Java practices, without altering its runtime behavior or core logic.

  • Key changes include:
    • Renamed getInfluxDBClient() to better reflect its purpose (e.g., getQueryApi()), improving semantic clarity.
    • Removed unnecessary code
      • (e.g., InterpreterContext) from methods where they are unused.
      • Throwing exceptions from methods like open(), close(), cancel(), getFormType(), and getProgress() where exceptions are not thrown.
    • Extracted long nested logic blocks in internalInterpret() into smaller, well-named private methods.
    • Replaced imperative loops with Stream operations for collection processing.

These changes aim to make the codebase more modular, clean by reducing boilerplate code, and approachable for future contributors and reviewers.

What type of PR is it?

Refactoring

Todos

  • - Task

What is the Jira issue?

How should this be tested?

  • No functional changes; existing tests should pass as-is.

Screenshots (if appropriate)

Questions:

  • Does the license files need to update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

@ParkGyeongTae ParkGyeongTae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@Reamer Reamer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Reamer Reamer merged commit ab52456 into apache:master Aug 4, 2025
15 of 18 checks passed
asf-gitbox-commits pushed a commit that referenced this pull request Aug 4, 2025
… and maintainability

### What is this PR for?
This PR refactors the `InfluxDBInterpreter.class` to improve code readability, maintainability, and adherence to modern Java practices, without altering its runtime behavior or core logic.

- Key changes include:
  - Renamed getInfluxDBClient() to better reflect its purpose (e.g., getQueryApi()), improving semantic clarity.
  - Removed unnecessary code
     - (e.g., InterpreterContext) from methods where they are unused.
     - Throwing exceptions from methods like open(), close(), cancel(), getFormType(), and getProgress() where exceptions are not thrown.
  - Extracted long nested logic blocks in `internalInterpret()` into smaller, well-named private methods.
  - Replaced imperative loops with Stream operations for collection processing.

These changes aim to make the codebase more modular, clean by reducing boilerplate code, and approachable for future contributors and reviewers.

### What type of PR is it?
Refactoring

### Todos
* [ ] - Task

### What is the Jira issue?
* [ZEPPELIN-6264](https://issues.apache.org/jira/browse/ZEPPELIN-6264)

### How should this be tested?
* No functional changes; existing tests should pass as-is.

### Screenshots (if appropriate)

### Questions:
* Does the license files need to update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Closes #5005 from eunhwa99/ZEPPELIN-6264.

Signed-off-by: Philipp Dallig <philipp.dallig@gmail.com>
(cherry picked from commit ab52456)
Signed-off-by: Philipp Dallig <philipp.dallig@gmail.com>
@Reamer

Reamer commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Merged into master and branch-0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants