Skip to content

Conversation

@LiJie20190102
Copy link
Contributor

Purpose of this pull request

Issue is #10123 . When obtaining data from Starrock, an exception prompt 'Unknown HostException' appears

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

…rrock, an exception prompt 'Unknown HostException' appears
@davidzollo
Copy link
Contributor

Can you add this param in StarRocks E2E?

@LiJie20190102
Copy link
Contributor Author

Can you add this param in StarRocks E2E?

After careful consideration, it is not convenient to construct this scenario using e2e. Currently, I have only encountered it in the k8s scenario. If tested through the k8s scenario, I think it would be more responsible. My configuration is optional and will not affect the functionality. What do you think? @davidzollo @zhangshenghang

davidzollo
davidzollo previously approved these changes Jan 4, 2026
Copy link
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

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

+1
LGTM
By the way, it's better to add UT if E2E is too difficult for this scenario.

Comment on lines 115 to 130
private static Map<String, Pair<String, String>> formatBeHostPortMapping(
SourceConfig sourceConfig) {
return sourceConfig.getBeHostPortMapping().stream()
.collect(
Collectors.toMap(
mapping -> {
// host:be_port
String[] hostInfo = mapping.getHost_port().split(":");
return hostInfo[0];
},
mapping -> {
// accessible ip and be_port
String[] accessIpInfo = mapping.getIp_port().split(":");
return Pair.of(accessIpInfo[0], accessIpInfo[1]);
}));
}
Copy link
Member

Choose a reason for hiding this comment

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

It is necessary to handle various abnormal configuration situations, such as missing colons, empty strings, null, etc.

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

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);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Map<String, Pair<String, String>> beHostPortMapping = formatBeHostPortMapping(sourceConfig);
Map<String, Pair<String, Integer>> beHostPortMapping = formatBeHostPortMapping(sourceConfig);

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

scan.params.scanner_thread_pool_thread_num = "3"
be_host_port_mapping = [
{
host_port = "pingt-7f5cf4cfdc-cn-0.headless.olap:9060:9060"
Copy link
Member

@zhangshenghang zhangshenghang Jan 4, 2026

Choose a reason for hiding this comment

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

Suggested change
host_port = "pingt-7f5cf4cfdc-cn-0.headless.olap:9060:9060"
host_port = "be_host_1:9060"

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


`StarRocks`集群`BE`的host:be_port与能够访问的ip:be_port映射关系。
该配置可选的,主要是解决计算集群不能够直接访问`BE``host`以及`be_port`的场景,如`StarRocks`部署在k8s中,但是flink不能直接访问`BE``host`以及`be_port`,利用此配置,`flink`可以能够访问`BE`以及`be_port`
例如 `[{"pingt-7f5cf4cfdc-cn-0.headless.olap:9060"="xx.xx.xx.xx:31088"}]`
Copy link
Member

Choose a reason for hiding this comment

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

Standardize the sample code a bit

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

Comment on lines 34 to 38
@OptionMark(description = "The be host and be_port")
private String host_port;

@OptionMark(description = "The accessible ip and be_port")
private String ip_port;
Copy link
Member

Choose a reason for hiding this comment

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

Use camel case naming

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

Comment on lines 80 to 87
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());
}
Copy link
Member

Choose a reason for hiding this comment

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

Add some logs to prompt the user

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

@LiJie20190102
Copy link
Contributor Author

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