blerer commented on a change in pull request #1321:
URL: https://github.com/apache/cassandra/pull/1321#discussion_r753079513



##########
File path: src/java/org/apache/cassandra/config/GuardrailsOptions.java
##########
@@ -0,0 +1,82 @@
+/*
+ * 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.Set;
+import java.util.function.Consumer;
+
+import org.apache.cassandra.db.guardrails.Guardrails;
+import org.apache.cassandra.db.guardrails.GuardrailsConfig;
+
+/**
+ * Configuration settings for guardrails populated from the Yaml file.
+ *
+ * <p>Note that the settings here must only be used to builf the {@link 
GuardrailsConfig} class and not directly by the
+ * code checking each guarded constraint. That code should use the higher 
level abstractions defined in
+ * {@link Guardrails}).
+ *
+ * <p>This contains a main setting, {@code enabled}, controlling if guardrails 
are globally active or not, and
+ * individual settings to control each guardrail.
+ *
+ * <p>We have 2 variants of guardrails, soft (warn) and hard (fail) limits, 
each guardrail having either one of the
+ * variants or both. Note in particular that hard limits only make sense for 
guardrails triggering during query
+ * execution. For other guardrails, say one triggering during compaction, 
failing does not make sense.
+ *
+ * <p>Additionally, each individual setting should have a specific value 
(typically -1 for numeric settings),
+ * that allows to disable the corresponding guardrail.
+ *
+ * <p>For consistency, guardrails based on a simple numeric threshold should 
use the naming scheme
+ * {@code <what_is_guarded>_warn_threshold} for soft limits and {@code 
<what_is_guarded>_fail_threshold} for hard
+ * ones, and if the value has a unit, that unit should be added at the end 
(for instance,
+ * {@code <what_is_guarded>_fail_threshold_in_kb}). For "boolean" guardrails 
that disable a feature, use
+ * {@code <what_is_guarded_enabled}. Other type of guardrails can use 
appropriate suffixes but should start with
+ * {@code <what_is_guarded>}.
+ */
+public class GuardrailsOptions

Review comment:
       @dcapwell  I believe that we should bring that discussion to the dev 
mailing list because using nested configurations have some impacts on 
differents patches on which people are currently working (e.g. CASSANDRA-15254, 
CASSANDRA-15234).
   We also need a global agreement for such a change of approach to ensure that 
everybody is on board and aware of it. Otherwise the yaml configuration might 
become too confusing.   




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