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

David Capwell commented on CASSANDRA-15254:
-------------------------------------------

bq. deprecated as they were found through reflection

Cool, so different than Ekaterina's version =D.  @Replaces was merged to 
trunk/cassandra-4.0 which allows renaming and marking the old name deprecated, 
but don't actually remember if @Deprecated was supported (since and forRemoval 
exists, so can leverage to provide useful warnings).

bq. Question: Shouldn't we expose deprecated properties until they are fully 
removed?

IMO yes, though settings vtable should prob return a ClientWarn if setting a 
deprecated name?

bq. An annoying job though.

With my POC it makes it rather low-hanging-fruit.  Let's say system properties 
start with the "cassandra." prefix, then we just walk and check if we have a 
flatten version found; else ignore

-Dcassandra.track_warnings.local_read_size.abort_threshold=1kb

we just strip off the "cassandra." bit, then check if 
"track_warnings.local_read_size.abort_threshold" property exists in the flatten 
version; if so we have a Property, which offers the ability to mutate objects

{code}
Map<String, Property> properties = Properties.getProperties(Config.java);
properties = Properties.flatten(properties);

Config conf = DatabaseDescriptor.getConf();

Properties sys = System.getProperties();
for (String field : sys.stringPropertyNames())
{
  if (!field.startsWith("cassandra."))
    continue;
  String value = sys.getProperty(field);
  field = field.replace("cassandra.", "");

  if (properties.contains(field))
    properties.get(field).set(conf, value);
}
{code}

The only real annoying bit are the stuff which are only system properties; we 
could move them to Config; which would also be so much nicer for jvm-dtests as 
system property isolation is a pain right now, though this could have issues as 
I think we don't always use snake casing...

> Allow UPDATE on settings virtual table to change running configurations
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-15254
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15254
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Feature/Virtual Tables
>            Reporter: Chris Lohfink
>            Assignee: Benjamin Lerer
>            Priority: Normal
>
> Allow using UPDATE on the system_views.settings virtual table to update 
> configs at runtime for the equivalent of the dispersed JMX 
> attributes/operations.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to