jaydeepkumar1984 commented on code in PR #4560:
URL: https://github.com/apache/cassandra/pull/4560#discussion_r2706448892


##########
src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:
##########
@@ -402,14 +403,25 @@ else if (retryCount < 
config.getRepairMaxRetries(repairType))
         }
     }
 
-    private boolean tooSoonToRunRepair(AutoRepairConfig.RepairType repairType, 
AutoRepairState repairState, AutoRepairConfig config, UUID myId)
+    @VisibleForTesting
+    boolean tooSoonToRunRepair(AutoRepairConfig.RepairType repairType, 
AutoRepairState repairState, AutoRepairConfig config, UUID myId)
     {
         if (repairState.getLastRepairTime() == 0)
         {
-            // the node has either just boooted or has not run repair before,
+            // the node has either just booted or has not run repair before,
             // we should check for the node's repair history in the DB
             
repairState.setLastRepairTime(AutoRepairUtils.getLastRepairTimeForNode(repairType,
 myId));

Review Comment:
   nit: rename "setLastRepairTime" to "setLastRepairFinishTime" to align with 
the newly added "setLastRepairStartTime"



##########
src/java/org/apache/cassandra/repair/autorepair/AutoRepairState.java:
##########
@@ -66,6 +66,8 @@ public abstract class AutoRepairState
     @VisibleForTesting
     protected long lastRepairTimeInMs;

Review Comment:
   Same as the above _lastRepairTimeInMs_ --> _lastRepairFinishTimeInMs_



##########
src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:
##########


Review Comment:
   Let's handle this corner case scenario as well. There are two separate calls 
"currentTimeMillis(), currentTimeMillis()" - let's just call it once and supply 
the same _start_ and _finish_ timestamps



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