yiguolei commented on code in PR #48187:
URL: https://github.com/apache/doris/pull/48187#discussion_r1968675656


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/FederationBackendPolicy.java:
##########
@@ -184,11 +162,25 @@ public void init(List<String> preLocations) throws 
UserException {
     }
 
     public void init(BeSelectionPolicy policy) throws UserException {
-        backends.addAll(policy.getCandidateBackends(Env.getCurrentSystemInfo()
-                .getBackendsByCurrentCluster().values().asList()));
+        ConnectContext ctx = ConnectContext.get();
+        List<Backend> backendList = null;
+        if (Config.isCloudMode()) {
+            if (ctx == null) {
+                throw new AnalysisException("ConnectContext is null");
+            }
+            backendList = ctx.getComputeGroup().getBackendList();
+        } else {
+            if (ctx == null) {
+                ctx = new ConnectContext();
+                ctx.setThreadLocalInfo();
+            }
+            backendList = 
ctx.getComputeGroupWithRuntimeException().getBackendList();

Review Comment:
   getComputeGroupWithRuntimeException  这种命名不好,不会吧自己抛啥异常写到函数名里的,比如如果一个函数抛两个异常咋写?



-- 
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: commits-unsubscr...@doris.apache.org

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