Skip to content

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

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

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

Conversation

@eunhwa99
Copy link
Copy Markdown
Contributor

@eunhwa99 eunhwa99 commented Aug 1, 2025

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

Copy link
Copy Markdown
Member

@ParkGyeongTae ParkGyeongTae left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Copy link
Copy Markdown
Contributor

@Reamer Reamer left a comment

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 <[email protected]>
(cherry picked from commit ab52456)
Signed-off-by: Philipp Dallig <[email protected]>
@Reamer
Copy link
Copy Markdown
Contributor

Reamer commented Aug 4, 2025

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