{"record":{"id":"8fd0f6ca4deb73d8","repo":"apache/cassandra","slug":"key-s-is-deprecated-should-switch-to-s","errorCode":null,"errorMessage":"key '%s' is deprecated; should switch to '%s'","messagePattern":"key '(.+?)' is deprecated; should switch to '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/db/virtual/SettingsTable.java","lineNumber":82,"sourceCode":"    {\n        super(TableMetadata.builder(keyspace, \"settings\")\n                           .comment(\"current settings\")\n                           .kind(TableMetadata.Kind.VIRTUAL)\n                           .partitioner(new LocalPartitioner(UTF8Type.instance))\n                           .addPartitionKeyColumn(NAME, UTF8Type.instance)\n                           .addRegularColumn(VALUE, UTF8Type.instance)\n                           .build());\n        this.config = config;\n        this.useJsonFormat = CassandraRelevantProperties.VIRTUAL_TABLE_COMPLEX_SETTINGS_FORMAT_JSON.getBoolean();\n    }\n\n    @Override\n    public DataSet data(DecoratedKey partitionKey)\n    {\n        SimpleDataSet result = new SimpleDataSet(metadata());\n        String name = UTF8Type.instance.compose(partitionKey.getKey());\n        if (BACKWARDS_COMPATIBLE_NAMES.containsKey(name))\n            ClientWarn.instance.warn(\"key '\" + name + \"' is deprecated; should switch to '\" + BACKWARDS_COMPATIBLE_NAMES.get(name) + \"'\");\n        if (PROPERTIES.containsKey(name))\n            result.row(name).column(VALUE, getValue(PROPERTIES.get(name)));\n        return result;\n    }\n\n    @Override\n    public DataSet data()\n    {\n        SimpleDataSet result = new SimpleDataSet(metadata());\n        for (Map.Entry<String, Property> e : PROPERTIES.entrySet())\n            result.row(e.getKey()).column(VALUE, getValue(e.getValue()));\n        return result;\n    }\n\n    @VisibleForTesting\n    String getValue(Property prop)\n    {\n        Redacted maybeCredential = prop.getAnnotation(Redacted.class);","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/SettingsTable.java#L64-L100","documentation":"SettingsTable.data() warns when a partition key that is a backwards-compatible alias of a renamed configuration property is queried: \"key '<name>' is deprecated; should switch to '<new name>'\". The value is still served under the old name; the warning nudges users to the canonical settings-table key.","triggerScenarios":"SELECT ... FROM system_views.settings WHERE name = '<old-config-name>' (or a single-partition read of that row) where the name is in BACKWARDS_COMPATIBLE_NAMES after a config property was renamed.","commonSituations":"Ops scripts reading virtual settings by pre-rename cassandra.yaml property names after upgrading Cassandra; documentation using old keys like renamed compaction/commitlog settings.","solutions":["Use the new key from the warning message in subsequent queries.","Update automation/scripts to the canonical setting names.","Cross-check current names with SELECT name FROM system_views.settings to see all valid keys."],"exampleFix":"// before\nSELECT * FROM system_views.settings WHERE name = 'old_property_name';\n\n// after (use the suggested new key)\nSELECT * FROM system_views.settings WHERE name = 'new_property_name';","handlingStrategy":"validation","validationCode":"// resolve the canonical key first\nboolean known = session.execute(\"SELECT name FROM system_views.settings\").all()\n    .stream().anyMatch(r -> r.getString(\"name\").equals(desiredKey));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Discover valid keys with SELECT name FROM system_views.settings instead of hardcoding old names.","Update scripts when config properties are renamed across versions.","Treat deprecation warnings in driver output as TODOs."],"tags":["deprecation","virtual-table","settings","config"],"backgroundTag":"deprecated-api-usage","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}