You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2023/01/05 18:35:31 UTC

[GitHub] [cassandra] Mmuzaf commented on a diff in pull request #2046: CASSANDRA-17797 All system properties and environment variables must be accessed via CassandraRelevantProperties

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


##########
test/distributed/org/apache/cassandra/distributed/fuzz/HarryHelper.java:
##########
@@ -26,19 +26,26 @@
 import harry.model.clock.OffsetClock;
 import harry.model.sut.PrintlnSut;
 
+import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_ALLOW_SIMPLESTRATEGY;
+import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_MINIMUM_REPLICATION_FACTOR;
+import static org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_TCACTIVE_OPENSSL;
+import static org.apache.cassandra.config.CassandraRelevantProperties.LOG4J2_DISABLE_JMX;
+import static org.apache.cassandra.config.CassandraRelevantProperties.LOG4J2_SHUTDOWNHOOKENABLED;
+import static org.apache.cassandra.config.CassandraRelevantProperties.ORG_APACHE_CASSANDRA_DISABLE_MBEAN_REGISTRATION;
+
 public class HarryHelper
 {
     public static void init()
     {
-        System.setProperty("log4j2.disableJmx", "true"); // setting both ways as changes between versions
-        System.setProperty("log4j2.disable.jmx", "true");
-        System.setProperty("log4j.shutdownHookEnabled", "false");
-        System.setProperty("cassandra.allow_simplestrategy", "true"); // makes easier to share OSS tests without RF limits
-        System.setProperty("cassandra.minimum_replication_factor", "0"); // makes easier to share OSS tests without RF limits
-
-        System.setProperty("cassandra.disable_tcactive_openssl", "true");
-        System.setProperty("relocated.shaded.io.netty.transport.noNative", "true");
-        System.setProperty("org.apache.cassandra.disable_mbean_registration", "true");
+        // setting both ways as changes between versions
+        System.setProperty("log4j2.disableJmx", "true"); // checkstyle: suppress nearby 'blockSystemPropertyUsage'
+        LOG4J2_DISABLE_JMX.setBoolean(true);
+        LOG4J2_SHUTDOWNHOOKENABLED.setBoolean(false);

Review Comment:
   Ok, it makes sense to me.
   I will file an issue right after we'll finish with the current changes.



##########
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:
   Fixed.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org