[fix](doriswriter)Fix the problem that specifying multiple loadurls does not take effect #29865

This commit is contained in:
caoliang-web
2024-01-12 16:35:48 +08:00
committed by yiguolei
parent b3e37b3efa
commit 9d3a017706

View File

@ -240,12 +240,10 @@ public class DorisStreamLoadObserver {
private String getLoadHost() {
List<String> hostList = options.getLoadUrlList();
long tmp = pos + hostList.size();
for (; pos < tmp; pos++) {
String host = new StringBuilder("http://").append(hostList.get((int) (pos % hostList.size()))).toString();
if (checkConnection(host)) {
return host;
}
Collections.shuffle(hostList);
String host = new StringBuilder("http://").append(hostList.get((0))).toString();
if (checkConnection(host)){
return host;
}
return null;
}