From e389cef6dafcbfd3c3566998968116250387a70c Mon Sep 17 00:00:00 2001 From: Yongqiang YANG Date: Fri, 3 Apr 2026 00:52:33 -0700 Subject: [PATCH] [opt](memory) Remove unused indexId field from CloudReplica (#62080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Remove the `indexId` field and its `@SerializedName` from `CloudReplica`, saving 8 bytes per replica object - The only external usage is debug logging in `CloudTabletStatMgr` which already uses `stat.getIdx().getIndexId()` from the proto response — no change needed - Constructor parameter is kept for source compatibility but the value is no longer stored - Gson silently ignores unknown keys when deserializing old images, so backward compatibility is maintained ## Memory Impact -8 bytes/replica. At 10M replicas: ~76 MB saved. At 100M replicas: ~763 MB saved. ## Test plan - [ ] Existing cloud tests pass (`mvn test -pl fe/fe-core -Dtest="*Cloud*"`) - [ ] Gson backward compatibility: old-format JSON with "indexId" key deserializes without errors (silently ignored) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 --- .../java/org/apache/doris/cloud/catalog/CloudReplica.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java b/fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java index 1030f3ef8897cf..359c49357f3635 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java +++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java @@ -65,8 +65,6 @@ public class CloudReplica extends Replica implements GsonPostProcessable { private long tableId = -1; @SerializedName(value = "partitionId") private long partitionId = -1; - @SerializedName(value = "indexId") - private long indexId = -1; @SerializedName(value = "idx") private long idx = -1; @@ -94,7 +92,6 @@ public CloudReplica(long replicaId, Long backendId, ReplicaState state, long ver this.dbId = dbId; this.tableId = tableId; this.partitionId = partitionId; - this.indexId = indexId; this.idx = idx; } @@ -558,10 +555,6 @@ public long getPartitionId() { return partitionId; } - public long getIndexId() { - return indexId; - } - public long getIdx() { return idx; }