Skip to content

[Question] The recommended way to use library #805

Description

@skarelin

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions