[ZEPPELIN-6264] Refactor InfluxDBInterpreter for improved readability and maintainability#5005
Merged
Reamer merged 3 commits intoapache:masterfrom Aug 4, 2025
Merged
Conversation
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]>
Contributor
|
Merged into master and branch-0.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
This PR refactors the
InfluxDBInterpreter.classto improve code readability, maintainability, and adherence to modern Java practices, without altering its runtime behavior or core logic.internalInterpret()into smaller, well-named private methods.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
What is the Jira issue?
How should this be tested?
Screenshots (if appropriate)
Questions: