-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Improve] StarRocksSourceReader use the existing client #6480
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
| @Override | ||
| public void open() throws Exception {} | ||
| public void open() throws Exception { | ||
| clientsPools = new LinkedHashMap<>(5); |
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.
Just HashMap enough.
| clientsPools = new LinkedHashMap<>(5); | |
| clientsPools = new HashMap<>(); |
| if (!clientsPools.isEmpty()) { | ||
| clientsPools.values().forEach(StarRocksBeReadClient::close); | ||
| } |
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.
Please add try catch in forEach. We should make sure all client will be invoked close method.
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.
Please add try catch in
forEach. We should make sure all client will be invoked close method.
done, please recheck at your convenience.
|
cc @531651225 |
| throw new StarRocksConnectorException( | ||
| CLOSE_BE_READER_FAILED, e); |
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.
Do not throw exception. It will break logic of close other client. Just log.error.
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.
done, please recheck at your convenience.


Purpose of this pull request
StarRocksSourceReader reads partition data using the existing client instead of re-establishing a connection for each partition.
Does this PR introduce any user-facing change?
no
How was this patch tested?
exist tests.
Check list
New License Guide
release-note.