Copilot commented on code in PR #59648:
URL: https://github.com/apache/doris/pull/59648#discussion_r2668235311


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java:
##########
@@ -296,99 +222,113 @@ public void setRowCount(long rowCount) {
     }
 
     public long getSegmentCount() {
-        return segmentCount;
+        throw new UnsupportedOperationException("getSegmentCount is not 
supported in Replica");
     }
 
     public void setSegmentCount(long segmentCount) {
-        this.segmentCount = segmentCount;
+        throw new UnsupportedOperationException("setSegmentCount is not 
supported in Replica");
     }
 
     public long getRowsetCount() {
-        return rowsetCount;
+        throw new UnsupportedOperationException("getRowsetCount is not 
supported in Replica");
     }
 
     public void setRowsetCount(long rowsetCount) {
-        this.rowsetCount = rowsetCount;
+        throw new UnsupportedOperationException("setRowCount is not supported 
in Replica");

Review Comment:
   The error message incorrectly mentions "setRowCount" instead of 
"setRowsetCount". This should be updated to accurately reflect the method name 
for better debugging.
   ```suggestion
           throw new UnsupportedOperationException("setRowsetCount is not 
supported in Replica");
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java:
##########
@@ -296,99 +222,113 @@ public void setRowCount(long rowCount) {
     }
 
     public long getSegmentCount() {
-        return segmentCount;
+        throw new UnsupportedOperationException("getSegmentCount is not 
supported in Replica");
     }
 
     public void setSegmentCount(long segmentCount) {
-        this.segmentCount = segmentCount;
+        throw new UnsupportedOperationException("setSegmentCount is not 
supported in Replica");
     }
 
     public long getRowsetCount() {
-        return rowsetCount;
+        throw new UnsupportedOperationException("getRowsetCount is not 
supported in Replica");
     }
 
     public void setRowsetCount(long rowsetCount) {
-        this.rowsetCount = rowsetCount;
+        throw new UnsupportedOperationException("setRowCount is not supported 
in Replica");
     }
 
     public long getLastFailedVersion() {
-        return lastFailedVersion;
+        return -1;
     }
 
     public long getLastFailedTimestamp() {
-        return lastFailedTimestamp;
+        return 0;
+    }
+
+    protected void setLastFailedVersion(long lastFailedVersion) {
+        if (lastFailedVersion != -1) {
+            throw new UnsupportedOperationException("setLastFailedVersion is 
not supported in Replica");
+        }
+    }
+
+    protected void setLastFailedTimestamp(long lastFailedTimestamp) {
+        if (lastFailedTimestamp == -1) {

Review Comment:
   The condition logic appears inconsistent with setLastFailedVersion. 
setLastFailedVersion throws when the value is NOT -1, but 
setLastFailedTimestamp throws when the value IS -1. This inconsistency may lead 
to confusion. Consider making both conditions follow the same pattern - either 
both should throw when not equal to -1, or document why the logic differs.
   ```suggestion
           if (lastFailedTimestamp != -1) {
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/LocalTablet.java:
##########
@@ -35,11 +35,33 @@ public class LocalTablet extends Tablet {
     private long cooldownTerm = -1;
     private final Object cooldownConfLock = new Object();
 
+    @SerializedName(value = "cv", alternate = {"checkedVersion"})
+    private long checkedVersion;
+    @SerializedName(value = "ic", alternate = {"isConsistent"})
+    private boolean isConsistent;
+
+    // last time that the tablet checker checks this tablet.
+    // no need to persist
+    private long lastStatusCheckTime = -1;
+
+    // last time for load data fail
+    private long lastLoadFailedTime = -1;
+
+    // if tablet want to add a new replica, but cann't found any backend to 
locate the new replica.

Review Comment:
   Spelling error in comment: "cann't" should be "can't".
   ```suggestion
       // if tablet want to add a new replica, but can't found any backend to 
locate the new 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: [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]

Reply via email to