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

[GitHub] [doris] luwei16 commented on a diff in pull request #19167: [feature](table) implement the round robin selection be when create tablet

luwei16 commented on code in PR #19167:
URL: https://github.com/apache/doris/pull/19167#discussion_r1181231182


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -2538,6 +2541,13 @@ private void createTablets(String clusterName, MaterializedIndex index, ReplicaS
         if (chooseBackendsArbitrary) {
             backendsPerBucketSeq = Maps.newHashMap();
         }
+
+        Map<Tag, Integer> nextIndexs = new HashMap<>();
+        for (Map.Entry<Tag, Short> entry : replicaAlloc.getAllocMap().entrySet()) {
+            // TODO: random roundrobin starting position
+            nextIndexs.put(entry.getKey(), 0);

Review Comment:
   > I think of an implementation, for reference:
   > 
   > 1. Select all candidate BE list according to the conditions (`tag`, `storage_medium`, etc.).
   > 2. In the list, select the BE with the least number of tablets as the starting node to start executing RoundRobin.
   > 
   > This method should be logically clearer, which is to separate the step of "filtering BE by condition" from the "execution of RR".
   
   done



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