jyothsnakonisa commented on code in PR #4557:
URL: https://github.com/apache/cassandra/pull/4557#discussion_r2750366421


##########
test/distributed/org/apache/cassandra/distributed/test/DataResurrectionCheckTest.java:
##########
@@ -137,14 +135,22 @@ private Throwable 
executeChecksOnInstance(IInvokableInstance instance, final Str
         {
             try
             {
-                DataResurrectionCheck check = new DataResurrectionCheck();
-                StartupChecksOptions startupChecksOptions = new 
StartupChecksOptions();
-                startupChecksOptions.enable(check_data_resurrection);
+                StartupChecksConfiguration checksConfiguration = 
DatabaseDescriptor.getStartupChecksConfiguration();
+                checksConfiguration.enable("check_data_resurrection");
+                //checksConfiguration.reset("check_data_resurrection");

Review Comment:
   Please remove commented code.



##########
test/unit/org/apache/cassandra/service/SystemPropertiesBasedFileSystemOwnershipCheckTest.java:
##########
@@ -31,5 +34,7 @@ public void setup()
         super.setup();
         properties = new 
WithProperties().set(CassandraRelevantProperties.FILE_SYSTEM_CHECK_OWNERSHIP_TOKEN,
 token)
                                          
.set(CassandraRelevantProperties.FILE_SYSTEM_CHECK_ENABLE, true);
+        StartupChecks startupChecks = new StartupChecks().withTest(new 
FileSystemOwnershipCheck());
+        options = new StartupChecksConfiguration(startupChecks, new 
HashMap<>());
     }
 }

Review Comment:
   Please add a new line in the end



##########
src/java/org/apache/cassandra/config/StartupChecksConfiguration.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.annotations.VisibleForTesting;
+
+import org.apache.cassandra.exceptions.StartupException;
+import org.apache.cassandra.service.StartupCheck;
+import org.apache.cassandra.service.StartupChecks;
+
+import static java.lang.Boolean.FALSE;
+import static java.lang.Boolean.TRUE;
+
+public class StartupChecksConfiguration
+{
+    public static final String ENABLED_PROPERTY = "enabled";
+
+    private final Map<String, Map<String, Object>> options = new HashMap<>();
+    private final StartupChecks startupChecks;
+
+    public StartupChecksConfiguration(StartupChecks startupChecks, Map<String, 
Map<String, Object>> options)
+    {
+        this.options.putAll(new HashMap<>(options));
+        this.startupChecks = startupChecks;
+
+        apply();
+    }
+
+    @VisibleForTesting
+    public StartupCheck getCheck(String name)
+    {
+        return startupChecks.getCheck(name);
+    }
+
+    private StartupCheck getConfigurableCheck(String name)
+    {
+        StartupCheck check = startupChecks.getCheck(name);
+        if (check == null)
+            return null;
+
+        if (!check.isConfigurable())
+            return null;

Review Comment:
   May be combine both if clauses?



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