gavinchou commented on code in PR #31772:
URL: https://github.com/apache/doris/pull/31772#discussion_r1516414416


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java:
##########
@@ -601,6 +601,23 @@ public void addReplica(long tabletId, Replica replica) {
         }
     }
 
+    // cloud mode, create table not need backendId, represent with -1.
+    public void addCloudReplica(long tabletId, Replica replica) {
+        long stamp = writeLock();
+        try {
+            Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
+                    "cloudTablet " + tabletId + " not exists, replica " + 
replica.getId());
+            replicaMetaTable.put(tabletId, (long) -1, replica);

Review Comment:
   try to use the original`addReplica` to reduce duplicated code?
   ```suggestion
               long bid = isCloudMode() ? -1 : replica.getBackendId();
               replicaMetaTable.put(tabletId, bid, replica);
   ```



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