-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[IOTDB-1463] Implement builder pattern for Session and SessionPool #3502
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job!
Only minor issues!
- As we can directly use
sh sbin/start-cli.shto connect server with default host "127.0.0.1" and default port "6667" using default user "root" with default password "root", So I think the host and port of session/sessionPool can also have default values. On the one hand, it is more convenient to test IoTDB locally, on the other hand, it makes the session/sessionPool interface consistent with CLI. BTW, it's my fault to make a wrong example. Actually, A built-in-class builder creation must be performed just like "Session.Builder.build()" rather than 'SessionBuilder.build()' - Please update the docs in
Programming-Native-API.md. - After this PR has been merged, please send an email to the community telling everyone how the new session/sessionPool can be created now.
|
Thanks for the comments! Have changed accordingly. I removed the old construction method in the docs and also changed examples, so that new users can use builder as a preferred way. Will blast out an email after this is merged~ |
OneSizeFitsQuorum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last minor issue!
session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
Outdated
Show resolved
Hide resolved
OneSizeFitsQuorum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wangchao316
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Providing a more fluent way to construct Session and SessionPool