You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wolfboys (via GitHub)" <gi...@apache.org> on 2023/03/14 06:21:06 UTC
[GitHub] [doris-flink-connector] wolfboys commented on a diff in pull request #123: minor optimize
wolfboys commented on code in PR #123:
URL: https://github.com/apache/doris-flink-connector/pull/123#discussion_r1135032107
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/backend/BackendClient.java:
##########
@@ -69,27 +69,23 @@ public BackendClient(Routing routing, DorisReadOptions readOptions) {
private void open() {
logger.debug("Open client to Doris BE '{}'.", routing);
TException ex = null;
- for (int attempt = 0; !isConnected && attempt < retries; ++attempt) {
+ for (int attempt = 0; attempt < retries; ++attempt) {
logger.debug("Attempt {} to connect {}.", attempt, routing);
TBinaryProtocol.Factory factory = new TBinaryProtocol.Factory();
transport = new TSocket(routing.getHost(), routing.getPort(), socketTimeout, connectTimeout);
TProtocol protocol = factory.getProtocol(transport);
client = new TDorisExternalService.Client(protocol);
- if (isConnected) {
- logger.info("Success connect to {}.", routing);
- return;
- }
try {
logger.trace("Connect status before open transport to {} is '{}'.", routing, isConnected);
if (!transport.isOpen()) {
transport.open();
isConnected = true;
Review Comment:
> maybe add log `logger.info("Success connect to {}.", routing);` in this be better?
okay, thanks for your review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org