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 2022/04/28 05:20:33 UTC

[GitHub] [cassandra] yifan-c commented on a diff in pull request #1573: CASSANDRA-17544 Rename DisableFlag to EnableFlag on Guardrails

yifan-c commented on code in PR #1573:
URL: https://github.com/apache/cassandra/pull/1573#discussion_r860490751


##########
src/java/org/apache/cassandra/db/guardrails/EnableFlag.java:
##########
@@ -24,35 +24,35 @@
 import org.apache.cassandra.service.ClientState;
 
 /**
- * A guardrail that completely disables the use of a particular feature.
+ * A guardrail that enables the use of a particular feature.
  *
- * <p>Note that this guardrail only aborts operations (if the feature is disabled) so is only meant for
+ * <p>Note that this guardrail only enables operations (if the feature is enables) so is only meant for
  * query-based guardrails (we're happy to reject queries deemed dangerous, but we don't want to create a guardrail
  * that breaks compaction for instance).
  */
-public class DisableFlag extends Guardrail
+public class EnableFlag extends Guardrail
 {
-    private final Predicate<ClientState> disabled;
+    private final Predicate<ClientState> enabled;
     private final String what;
 
     /**
-     * Creates a new {@link DisableFlag} guardrail.
+     * Creates a new {@link EnableFlag} guardrail.
      *
      * @param name     the identifying name of the guardrail
-     * @param disabled a {@link ClientState}-based supplier of boolean indicating whether the feature guarded by this
-     *                 guardrail must be disabled.
+     * @param enabled a {@link ClientState}-based supplier of boolean indicating whether the feature guarded by this
+     *                 guardrail is enabled.
      * @param what     The feature that is guarded by this guardrail (for reporting in error messages),

Review Comment:
   I know it is not part of the patch... it just feels a bit unclear to use `what` as a var name. Probably use `featureName`.



##########
src/java/org/apache/cassandra/db/guardrails/EnableFlag.java:
##########
@@ -24,35 +24,35 @@
 import org.apache.cassandra.service.ClientState;
 
 /**
- * A guardrail that completely disables the use of a particular feature.
+ * A guardrail that enables the use of a particular feature.
  *
- * <p>Note that this guardrail only aborts operations (if the feature is disabled) so is only meant for
+ * <p>Note that this guardrail only enables operations (if the feature is enables) so is only meant for

Review Comment:
   The original content `only aborts operations (if the feature is disabled)` is easier to understand. 



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