You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Gabriel39 (via GitHub)" <gi...@apache.org> on 2023/04/26 12:32:10 UTC

[GitHub] [doris] Gabriel39 commented on a diff in pull request #19121: [feature](executor) Use the heartbeat BE info to set pipeline variables.

Gabriel39 commented on code in PR #19121:
URL: https://github.com/apache/doris/pull/19121#discussion_r1177804551


##########
fe/fe-core/src/main/java/org/apache/doris/qe/BackendInfo.java:
##########
@@ -0,0 +1,67 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.qe;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class BackendInfo {
+
+    // BackendInfo . Afterwards, memory infor may be added.
+    private long coreSize = 1;
+
+    private static Map<Long, BackendInfo> Info;
+    private static long mincorSize = 9999;
+
+    static {
+        Info = new HashMap<>();
+    }
+
+    public BackendInfo(long coreSize) {
+        this.coreSize = coreSize;
+    }
+
+    public long getcoreSize() {
+        return coreSize;
+    }
+
+    public static void clear() {
+        Info.clear();
+        mincorSize = 9999;
+    }
+
+    public static void addBeInfo(long beId, long coreSize) {
+        Info.put(beId, new BackendInfo(coreSize));
+        mincorSize = Math.min(mincorSize, coreSize);
+    }
+
+    public static long getMincorSize() {

Review Comment:
   ```suggestion
       public static long getMinNumCores() {
   ```



##########
gensrc/thrift/HeartbeatService.thrift:
##########
@@ -43,6 +43,7 @@ struct TBackendInfo {
     5: optional string version
     6: optional i64 be_start_time
     7: optional string be_node_role
+    8: optional i64 core_size

Review Comment:
   ```suggestion
       8: optional i64 num_cores
   ```



-- 
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-unsubscribe@doris.apache.org

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


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