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


##########
src/java/org/apache/cassandra/gms/FailureDetector.java:
##########
@@ -62,14 +66,13 @@ public class FailureDetector implements IFailureDetector, 
FailureDetectorMBean
 
     private static long getMaxLocalPause()
     {
-        if (System.getProperty("cassandra.max_local_pause_in_ms") != null)
-        {
-            long pause = 
Long.parseLong(System.getProperty("cassandra.max_local_pause_in_ms"));
-            logger.warn("Overriding max local pause time to {}ms", pause);
-            return pause * 1000000L;
-        }
-        else
-            return DEFAULT_MAX_PAUSE;
+        long pause = MAX_LOCAL_PAUSE_IN_MS.getLong();
+
+        if 
(!String.valueOf(pause).equalsIgnoreCase(MAX_LOCAL_PAUSE_IN_MS.getDefaultValue()))

Review Comment:
   why does this have to be `equalsIgnoreCase`? `pause` is a number. A number 
can never be "uppercased".



##########
src/java/org/apache/cassandra/gms/FailureDetector.java:
##########
@@ -476,16 +470,12 @@ public long[] getArrivalIntervals()
 
     private static long getMaxInterval()
     {
-        String newvalue = System.getProperty("cassandra.fd_max_interval_ms");

Review Comment:
   ok



##########
src/java/org/apache/cassandra/gms/FailureDetector.java:
##########
@@ -93,16 +91,12 @@ public FailureDetector()
 
     private static long getInitialValue()
     {
-        String newvalue = System.getProperty("cassandra.fd_initial_value_ms");

Review Comment:
   ok looks fine



##########
src/java/org/apache/cassandra/gms/FailureDetector.java:
##########
@@ -53,6 +56,7 @@ public class FailureDetector implements IFailureDetector, 
FailureDetectorMBean
     private static final Logger logger = 
LoggerFactory.getLogger(FailureDetector.class);
     public static final String MBEAN_NAME = 
"org.apache.cassandra.net:type=FailureDetector";
     private static final int SAMPLE_SIZE = 1000;
+    private static final long DEFAULT_FD_INITIAL_VALUE_MS = 
Gossiper.intervalInMillis * 2;

Review Comment:
   why is it important for you to extract this computation to dedicated static 
property? why not to use it where you need it? At least we postpone static 
initialisation of all other variables in Gossiper until we really have to do 
that.



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