wuyunfeng commented on a change in pull request #5325:
URL: https://github.com/apache/incubator-doris/pull/5325#discussion_r598519935



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsRestClient.java
##########
@@ -172,6 +166,13 @@ private String execute(String path) throws 
DorisEsException {
         DorisEsException scratchExceptionForThrow = null;
         OkHttpClient httpClient;
         if (useSslClient) {
+            if (sslNetworkClient == null) {

Review comment:
       This would leading to condition competition for `sslNetworkClient`, 
suggest use `synchronized ` method such as `getSSLNetworkClient`

##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsShardPartitions.java
##########
@@ -94,16 +94,22 @@ public static EsShardPartitions findShardPartitions(String 
indexName, String sea
         return partitions;
     }
 
-    public void addHttpAddress(Map<String, EsNodeInfo> nodesInfo) {
+    public void addHttpAddress(Map<String, EsNodeInfo> nodesInfo, boolean 
httpSslEnabled) {
         for (Map.Entry<Integer, List<EsShardRouting>> entry : 
shardRoutings.entrySet()) {
             List<EsShardRouting> shardRoutings = entry.getValue();
             for (EsShardRouting shardRouting : shardRoutings) {
                 String nodeId = shardRouting.getNodeId();
+                TNetworkAddress httpAddress;
                 if (nodesInfo.containsKey(nodeId)) {
-                    
shardRouting.setHttpAddress(nodesInfo.get(nodeId).getPublishAddress());
+                    httpAddress = nodesInfo.get(nodeId).getPublishAddress();
                 } else {
-                    shardRouting.setHttpAddress(randomAddress(nodesInfo));
+                    httpAddress = randomAddress(nodesInfo);
                 }
+                // If ssl is enabled, determine if the https protocol is 
required
+                if (httpSslEnabled && 
!httpAddress.getHostname().startsWith("http")) {
+                    httpAddress.setHostname("https://"; + 
httpAddress.getHostname());

Review comment:
       why `setHostname` ?? Is `setHttpAddress` does not work??




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to