Copilot commented on code in PR #59759:
URL: https://github.com/apache/doris/pull/59759#discussion_r2681097533
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java:
##########
@@ -889,4 +889,12 @@ public void setLastTimeNoPathForNewReplica(long
lastTimeNoPathForNewReplica) {
throw new
UnsupportedOperationException("setLastTimeNoPathForNewReplica is not supported
in Tablet");
}
}
+
+ public long getLastCheckTime() {
+ return -1;
+ }
+
+ public void setLastCheckTime(long lastCheckTime) {
+ throw new UnsupportedOperationException("setLastCheckTime is not
supported in Tablet");
+ }
Review Comment:
Consider adding a comment explaining that this default implementation
returns -1 because consistency checking is only supported for LocalTablet, not
for CloudTablet. This would help future maintainers understand why the default
implementation doesn't throw an exception and why CloudTablet doesn't override
these methods.
##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java:
##########
@@ -470,7 +471,18 @@ private long getIndexByBeNum(long hashValue, int beNum) {
return (hashValue % beNum + beNum) % beNum;
}
- public List<Long> hashReplicaToBes(String clusterId, boolean isBackGround,
int replicaNum)
+ private void initMemClusterToBackends() {
+ // the enable_cloud_multi_replica is not used now
+ if (memClusterToBackends == null) {
+ synchronized (this) {
+ if (memClusterToBackends == null) {
+ memClusterToBackends = new ConcurrentHashMap<>();
+ }
+ }
+ }
+ }
Review Comment:
The double-checked locking pattern is correct, but the comment on line 475
is misleading. The comment says "the enable_cloud_multi_replica is not used
now", but the initialization is actually used when
Config.enable_cloud_multi_replica is true (line 310). Consider updating the
comment to clarify that this lazy initialization is to save memory when the
multi-replica feature is not enabled.
--
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]