zhangshenghang commented on code in PR #10238:
URL: https://github.com/apache/seatunnel/pull/10238#discussion_r2659620816
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java:
##########
@@ -69,8 +73,19 @@ public StarRocksBeReadClient(String beNodeInfo, SourceConfig
sourceConfig) {
StarRocksConnectorErrorCode.CREATE_BE_READER_FAILED,
String.format("Format of StarRocks BE address[%s] is
illegal", beNodeInfo));
}
- this.ip = hostPort[0].trim();
- this.port = Integer.parseInt(hostPort[1].trim());
+
+ // If the user has configured beHostPortMapping, we need to parse it
+ Map<String, Pair<String, String>> beHostPortMapping =
formatBeHostPortMapping(sourceConfig);
+
+ if (beHostPortMapping.containsKey(hostPort[0].trim())) {
+ Pair<String, String> accessIpPort =
beHostPortMapping.get(hostPort[0].trim());
+ this.ip = accessIpPort.getKey();
+ this.port = Integer.parseInt(accessIpPort.getValue());
+ } else {
+ this.ip = hostPort[0].trim();
+ this.port = Integer.parseInt(hostPort[1].trim());
+ }
Review Comment:
Add some logs to prompt the user
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]