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

[Question] The recommended way to use library #805

Open
skarelin opened this issue Jan 2, 2025 · 0 comments
Open

[Question] The recommended way to use library #805

skarelin opened this issue Jan 2, 2025 · 0 comments

Comments

@skarelin
Copy link

skarelin commented Jan 2, 2025

Hi guys, sorry for raising a bug. I didn't find better place to ask the question.

What's the best recommended way to use your library for reading and writing the data? String flux/measurements/anything else?
My concern is about data consistency. Look at the following code:

        Flux fluxQuery = Flux.from(influxDBProperties.getBucketChart())
                .range(-31L, ChronoUnit.DAYS)
                .filter(Restrictions.and(
                        Restrictions.measurement().equal("sentiment"),
                        Restrictions.tag("asset").equal(assetType.toString()),
                        Restrictions.tag("timeframe").equal(timeframeType.toString())
                ))
                .pivot()
                .withRowKey(new String[]{"_time"})
                .withColumnKey(new String[]{"_field"})
                .withValueColumn("_value")
                .tail(1);

I kinda worry on providing names of tags/measurements like this. I don't like to keep it as strings. Because later it's very difficult to change the code at every possible place in case of breaking change. Any small typo would cause the issue. For example, in case of JPA, there are entities and repositories and I do not worry about that. Here's a bit different case. I do not see any other choice at this moment.

Do you have any recommendation?
@bednar maybe you can take a look?

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

No branches or pull requests

1 participant