smiklosovic commented on code in PR #4433:
URL: https://github.com/apache/cassandra/pull/4433#discussion_r2468810092


##########
src/java/org/apache/cassandra/service/GCInspector.java:
##########
@@ -407,6 +437,40 @@ public void setGcLogThresholdInMs(long threshold)
         DatabaseDescriptor.setGCLogThreshold((int) threshold);
     }
 
+    public int getGcConcurrentPhaseWarnThresholdInMs()
+    {
+        return DatabaseDescriptor.getGCConcurrentPhaseWarnThreshold();
+    }
+
+    public void setGcConcurrentPhaseWarnThresholdInMs(int threshold)
+    {
+        long gcConcurrentPhaseLogThresholdInMs = 
getGcConcurrentPhaseLogThresholdInMs();
+        if (threshold < 0)
+            throw new IllegalArgumentException("Threshold must be greater than 
or equal to 0");
+        if (threshold != 0 && threshold <= gcConcurrentPhaseLogThresholdInMs)
+            throw new IllegalArgumentException("Threshold must be greater than 
gcConcurrentPhaseLogThresholdInMs which is currently "
+                                               + 
gcConcurrentPhaseLogThresholdInMs);
+        DatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(threshold);
+    }
+
+    public int getGcConcurrentPhaseLogThresholdInMs()
+    {
+        return DatabaseDescriptor.getGCConcurrentPhaseLogThreshold();
+    }
+
+    public void setGcConcurrentPhaseLogThresholdInMs(int threshold)

Review Comment:
   I get that what you did here just follows the style which was already there 
and there is nothing wrong with it as such but I just wonder if we could not 
move the logic of this into DD's method and this one would just call it. I get 
that the methods need to be here because we are exposing them in MBean but the 
logic itself might be just moved to DD, no? 
   
   Because if somebody every calls DD methods, there is no validation. But it 
is just here. So everybody has to go through this method to get the validation. 
If we moved it to DD then it would be validated every time, regardless from 
where it is called. 
   
   DD currently also contains methods which have some basic validation around 
its parameters so ... 



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