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

docs: update onboarding steps for Java v3 client #6994

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

karel-rehor
Copy link
Contributor

Updates the onboarding steps for the Java v3 client.
Introduces new library features.

  • Query parameters
  • Up to date Write API

Checklist

Authors and Reviewer(s), please verify the following:

  • A PR description, regardless of the triviality of this change, that communicates the value of this PR
  • Well-formatted conventional commit messages that provide context into the change
  • Documentation updated or issue created (provide link to issue/PR)
  • Signed CLA (if not already signed)
  • Feature flagged, if applicable

@karel-rehor karel-rehor requested a review from bednar January 7, 2025 09:26
@karel-rehor karel-rehor requested review from a team as code owners January 7, 2025 09:26
@hansenreid hansenreid requested a review from wdoconnell January 7, 2025 13:47
Copy link
Contributor

@wdoconnell wdoconnell left a comment

Choose a reason for hiding this comment

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

Hi @karel-rehor - thank you, I had a few observations here:

  1. This variant of the onboarding flow is behind the ioxOnboarding feature flag, so it won't be shown for any users with that flag disabled; the Flux onboarding will otherwise be shown. That flag is enabled generally, but I will check with others if that is the right approach here.
  2. This makes the Java onboarding examples a good amount longer - I am not sure if that is desirable unless this is also intended as a bug fix or for some other purpose. Can you speak to the motivation behind the work?
  3. Not absolutely necessary in all cases, but for a PR like this that has visual impact on the flow, I usually find it is helpful for the review to include a video illustrating what was changed.

const query = ` String sql = "SELECT * " +
"FROM 'census' " +
"WHERE time >= now() - interval '5 minutes' " +
"AND ('$species1' IS NOT NULL OR '$species2' IS NOT NULL) order by time asc";
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we updating this query due to a failure with the test dataset, or is this simply designed to illustrate a different principle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Query parameters are a feature added in the 0.6.0 client library release from March of last year.

The text above the snippet briefly introduces them: "The following code replaces the fixed values of "bees" and "ants" with the parameters $species1 and $species2."

We thought users would like to be made aware of this feature. A number of users requested it and are now using it.

<p>
The query transport makes use of Apache Arrow Flight to shorten
processing time. When executing queries Arrow needs access to internal
JVM resources. This means setting the following JVM argument:{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

I might correct "means" to "This requires setting the following JVM argument"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

</p>
<h2>Java</h2>
<p>
With straightforward Java this can be done with an environment variable:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should qualify whether the script is 'straightforward' since it should speak for itself -- "This can be done with an environment variable" should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@wdoconnell
Copy link
Contributor

Remocal failure in CI looks transient, so I am re-running the tests.

@karel-rehor
Copy link
Contributor Author

karel-rehor commented Jan 8, 2025

Hi @wdoconnell

  1. This variant of the onboarding flow is behind the ioxOnboarding feature flag, so it won't be shown for any users with that flag disabled; the Flux onboarding will otherwise be shown. That flag is enabled generally, but I will check with others if that is the right approach here.

My understanding is that we primarily want these changes visible to cloud users and in the cloud interface, which, if I understand correctly, should have ioxOnboarding enabled.

  1. This makes the Java onboarding examples a good amount longer - I am not sure if that is desirable unless this is also intended as a bug fix or for some other purpose. Can you speak to the motivation behind the work?

The influxdb3 client libraries have evolved considerably since these onboarding steps were first written. Since the beginning of December client libraries are progressively being released to the first major version 1.0 (and in the case of go 2.0) because of breaking changes. The new onboarding steps illustrate the following features added in the past last year:

  • Query parameters
  • Arrow flight support for queries
  • Handling of null/nil values
  • Leveraging Arrow metadata during deserialization

I also though it would be helpful to organize test data into a POJO as it is a common Java idiom,

  1. Not absolutely necessary in all cases, but for a PR like this that has visual impact on the flow, I usually find it is helpful for the review to include a video illustrating what was changed.

OK, I thought that I would need to take time to compress the screencast file, as in the past I had encountered a 10MB limit, but it seems this can be added. This shows only the workflow without pasting snippets to an IDE.

Screencast.from.08-01-25.10.57.08.webm

@karel-rehor karel-rehor requested a review from wdoconnell January 9, 2025 09:21
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.

2 participants