[ 
https://issues.apache.org/jira/browse/CASSANDRA-17544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17532176#comment-17532176
 ] 

Andres de la Peña commented on CASSANDRA-17544:
-----------------------------------------------

CI with repeated runs after rebasing once again and adding [the missing 
{{@Test}} tag in 
{{GuardrailsTest#testEnableFlag}}|https://github.com/adelapena/cassandra/commit/24916dc27053847801ace1232106ef04f31f210c]:
||PR||CI||
|[trunk|https://github.com/apache/cassandra/pull/1573]|[j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/1526/workflows/b0dd505d-8a85-4d64-8a79-e99de988615c]
 
[j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/1526/workflows/9bff3132-61d5-4317-ace3-9d1651dc1fef]|

> Add EnableFlag to guardrails API
> --------------------------------
>
>                 Key: CASSANDRA-17544
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17544
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Feature/Guardrails
>            Reporter: Josh McKenzie
>            Assignee: Bernardo Botella Corbi
>            Priority: Low
>             Fix For: 4.1
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently we only have a DisableFlag which, for guardrails where we're 
> enabling or disabling a feature, leads to some pretty odd ergonomics in the 
> code. For example:
>  
> {code:java}
> public static final DisableFlag compactTablesEnabled =
> new DisableFlag("compact_tables",
>                 state -> 
> !CONFIG_PROVIDER.getOrCreate(state).getCompactTablesEnabled(),
>                 "Creation of new COMPACT STORAGE tables"); {code}
> So far, the usage of these toggle flags appears to be skewed heavily towards 
> the inverse, or an EnableFlag that'd look something like this:
> {code:java}
> public static final EnableFlag featureEnabled = new 
> EnableFlag("feature_name", state -> 
> CONFIG_PROVIDER.getOrCreate(state).getCompactTablesEnabled(), "Text for 
> feature"); {code}
> While it's a relatively small change it'll help tidy up some of the 
> guardrails framework and make the logic clearer.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to