Skip to content

Conversation

@xiaochen-zhou
Copy link
Contributor

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

@Hisoka-X Hisoka-X added improve First-time contributor First-time contributor labels Mar 11, 2024
@Override
public void open() throws Exception {}
public void open() throws Exception {
clientsPools = new LinkedHashMap<>(5);
Copy link
Member

Choose a reason for hiding this comment

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

Just HashMap enough.

Suggested change
clientsPools = new LinkedHashMap<>(5);
clientsPools = new HashMap<>();

Comment on lines 119 to 133
if (!clientsPools.isEmpty()) {
clientsPools.values().forEach(StarRocksBeReadClient::close);
}
Copy link
Member

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.

Copy link
Contributor Author

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.

@Hisoka-X
Copy link
Member

cc @531651225

Comment on lines 131 to 132
throw new StarRocksConnectorException(
CLOSE_BE_READER_FAILED, e);
Copy link
Member

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.

Copy link
Contributor Author

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.

@Hisoka-X
Copy link
Member

Please follow the guide to open ci on your fork repository. Thanks.
image

@xiaochen-zhou
Copy link
Contributor Author

Please follow the guide to open ci on your fork repository. Thanks. image

Thank you very much, I will try to complete it according to your guidance

@hailin0 hailin0 merged commit 1a02c57 into apache:dev Mar 12, 2024
chaorongzhi pushed a commit to chaorongzhi/seatunnel that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants