dataroaring opened a new pull request, #62081: URL: https://github.com/apache/doris/pull/62081
## Summary - Remove `tableId` and `partitionId` fields from `CloudReplica`, replacing them with a transient `tabletId` field that enables O(1) lookups via `TabletMeta` in the inverted index - The `tabletId` is populated in `CloudTabletInvertedIndex.addReplica()`, which is called both at tablet creation time and during image load via `recreateTabletInvertIndex()` - Internal methods (`isColocated()`, `hashReplicaToBe()`, `hashReplicaToBes()`, `getColocatedBeId()`) now look up `tableId`/`partitionId` from `TabletMeta` - External caller in `CloudInternalCatalog` replaced with direct `TabletMeta` lookup - Constructor simplified to remove `tableId`/`partitionId` parameters; all callers updated - `TabletInvertedIndex.getTabletMeta()` uses `StampedLock.readLock()` + `Long2ObjectOpenHashMap.get()` — O(1) with minimal contention ## Memory Impact Net -8 bytes/replica (remove 2 longs = -16, add 1 transient long = +8). At 10M replicas: ~76 MB saved. At 100M replicas: ~763 MB saved. ## Files Changed - `CloudReplica.java` — remove fields, add tabletId + helper methods, simplify constructor - `CloudTabletInvertedIndex.java` — set tabletId on replica in addReplica() - `CloudInternalCatalog.java` — update constructor call + TabletMeta lookup - `OlapTable.java` — update constructor call - `CloudRestoreJob.java` — update constructor call - `CatalogTestUtil.java` — update constructor calls ## Test plan - [ ] Existing cloud tests pass (`mvn test -pl fe/fe-core -Dtest="*Cloud*"`) - [ ] Verify TabletMeta lookup works correctly for colocated and non-colocated tables - [ ] Gson backward compatibility: old-format JSON with "tableId"/"partitionId" keys deserializes without errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
