Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: abstract data explorer modules from Influx-related code #2803

Merged
merged 19 commits into from
May 3, 2024

Conversation

bossenti
Copy link
Contributor

Purpose

This PR continues the work of #2795 and abstracts the data explorer code from Influx-specific implementations. The idea is that whenever we want to interact with our data explorer storage we do not point to storage-specific implementations but use the DataExplorerDispatcher instead. The DataExplorerDispatcher gives aces to an an instance of DataExplorerManager which is tied to the underlying storage dependent on the configuration of StreamPipes. Therefore, this PR introduces the environment variable SP_TS_STORAGE which determines the storage to be used and defaults to influxDB.
As for now, Influx is the only storage supported but this allows us to better separate our codebase and to integrate other time series storages as well.

Remarks

PR introduces (a) breaking change(s): yes

PR introduces (a) deprecation(s): no

Breaking Changes

This PR strongly moves files between different modules and therefore import paths might change, especially with respect to the module streampipes-data-explorer-influx. This PR does not have any affect on the behavior or any feature of StreamPipes.

@bossenti bossenti added this to the 0.97.0 milestone Apr 30, 2024
@github-actions github-actions bot added dependencies Pull requests that update a dependency file java Pull requests that update Java code pipeline elements Relates to pipeline elements backend Everything that is related to the StreamPipes backend testing Relates to any kind of test (unit test, integration, or E2E test). labels Apr 30, 2024
Copy link
Contributor

@tenthe tenthe left a comment

Choose a reason for hiding this comment

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

Hi @bossenti,

thanks for the PR.
I like the idea of the env variable.

I just have some minor questions, see comments.

Cheers,
Philipp

import org.apache.streampipes.dataexplorer.api.IDataExplorerManager;
import org.apache.streampipes.dataexplorer.influx.DataExplorerManagerInflux;

public enum DataExplorerDispatcher {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to change this to a class that we can more easily mock for testing instead of a singleton?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed DataExplorerDispatcher to a regular class, check if that suits your expectations

@bossenti bossenti merged commit b75cc2b into dev May 3, 2024
21 checks passed
@bossenti bossenti deleted the abstract-data-explorer-from-influx branch May 3, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Everything that is related to the StreamPipes backend dependencies Pull requests that update a dependency file java Pull requests that update Java code pipeline elements Relates to pipeline elements testing Relates to any kind of test (unit test, integration, or E2E test).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants