morningman commented on code in PR #60921:
URL: https://github.com/apache/doris/pull/60921#discussion_r3339455114


##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java:
##########
@@ -60,18 +61,21 @@ public class HttpUtils {
     static final int DEFAULT_TIME_OUT_MS = 2000;
 
     public static List<Pair<String, Integer>> getFeList() {
+        int port = Config.enable_https ? Config.https_port : Config.http_port;
         return Env.getCurrentEnv().getFrontends(null)
-                .stream().filter(Frontend::isAlive).map(fe -> 
Pair.of(fe.getHost(), Config.http_port))
+                .stream().filter(Frontend::isAlive).map(fe -> 
Pair.of(fe.getHost(), port))
                 .collect(Collectors.toList());
     }
 
     static boolean isCurrentFe(String ip, int port) {

Review Comment:
   This method is not used?



##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/QueryProfileAction.java:
##########
@@ -196,7 +196,7 @@ public Object queryInfo(HttpServletRequest request, 
HttpServletResponse response
         // add node information
         for (List<String> query : queries) {
             query.set(1, 
NetUtils.getHostPortInAccessibleFormat(Env.getCurrentEnv().getSelfNode().getHost(),
-                    Config.http_port));
+                    Config.enable_https ? Config.https_port : 
Config.http_port));

Review Comment:
   ### Remove the repeated port ternary
   
   `Config.enable_https ? Config.https_port : Config.http_port` is repeated 
about ten times across `NodeAction`, `ClusterAction`, `QueryProfileAction`, 
`HeartbeatMgr`, `HttpUtils`, and `MinidumpUtils`. The PR already centralizes 
URL construction in `buildInternalFeUrl`; do the same for the bare port 
selection (e.g. a `HttpURLUtil.getInternalFePort()` helper or a convenience 
accessor on `Config`). This removes scattered copies of the same branch and 
reduces the risk of a future partial change.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to