{"record":{"id":"42b919480a22f906","repo":"apache/cassandra","slug":"the-class-name-option-must-be-specified","errorCode":null,"errorMessage":"The 'class_name' option must be specified.","messagePattern":"The 'class_name' option must be specified\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/MemtableParams.java","lineNumber":225,"sourceCode":"    private static MemtableParams parseConfiguration(String configurationKey)\n    {\n        ParameterizedClass definition = CONFIGURATION_DEFINITIONS.get(configurationKey);\n\n        if (definition == null)\n            throw new ConfigurationException(\"Memtable configuration \\\"\" + configurationKey + \"\\\" not found.\");\n        return new MemtableParams(getMemtableFactory(definition), configurationKey);\n    }\n\n\n    private static Memtable.Factory getMemtableFactory(ParameterizedClass options)\n    {\n        // Special-case this so that we don't initialize memtable class for tests that need to delay that.\n        if (options == DEFAULT_CONFIGURATION)\n            return DEFAULT_MEMTABLE_FACTORY;\n\n        String className = options.class_name;\n        if (className == null || className.isEmpty())\n            throw new ConfigurationException(\"The 'class_name' option must be specified.\");\n\n        className = className.contains(\".\") ? className : \"org.apache.cassandra.db.memtable.\" + className;\n        try\n        {\n            Memtable.Factory factory;\n            Class<?> clazz = Class.forName(className, false, MemtableParams.class.getClassLoader());\n            final Map<String, String> parametersCopy = options.parameters != null\n                                                       ? new HashMap<>(options.parameters)\n                                                       : new HashMap<>();\n            try\n            {\n                Method factoryMethod = clazz.getDeclaredMethod(\"factory\", Map.class);\n                if (!Memtable.Factory.class.isAssignableFrom(factoryMethod.getReturnType()))\n                    throw new ClassCastException(\"Memtable factory method on \" + className +\n                                                 \" must return \" + Memtable.Factory.class.getName());\n                factory = (Memtable.Factory) factoryMethod.invoke(null, parametersCopy);\n            }\n            catch (NoSuchMethodException e)","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/MemtableParams.java#L207-L243","documentation":"Thrown from MemtableParams.getMemtableFactory when a memtable configuration entry (other than the built-in default) lacks a 'class_name' option. Cassandra needs the fully-qualified or short memtable class name to instantiate the Memtable.Factory, so a ConfigurationException is raised.","triggerScenarios":"cassandra.yaml memtable_configurations entry like 'my_conf: {inherits: default}' or an entry whose class_name key is empty/missing, resolved via parseConfiguration -> getMemtableFactory at startup; inheritance expands parameters but class_name may still be absent if neither the entry nor any inherited entry defines it.","commonSituations":"Writing an entry that only sets parameters assuming the class is inherited but the base entry also lacks class_name, YAML indentation error placing class_name under the wrong key, typos like class-name or classname.","solutions":["Add class_name to the memtable configuration entry in cassandra.yaml (short names are expanded to org.apache.cassandra.db.memtable.*).","Ensure the entry inherits from a base entry that actually defines class_name.","Fix the YAML key spelling to exactly class_name and verify indentation."],"exampleFix":"# before (cassandra.yaml)\nmemtable_configurations:\n  cheap:\n    inherits: default\n# after\nmemtable_configurations:\n  cheap:\n    inherits: default\n    class_name: org.apache.cassandra.db.memtable.SkipListMemtable","handlingStrategy":"validation","validationCode":"# ensure every non-default entry has a class_name (possibly via inherited entry)\npython3 -c \"import yaml; c=yaml.safe_load(open('conf/cassandra.yaml')); mc=c.get('memtable_configurations',{}); [print('missing class_name:',k) for k,v in mc.items() if isinstance(v,dict) and not v.get('class_name') and not any(mc.get(i,{}).get('class_name') for i in [v.get('inherits')] if i)]\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set class_name in each entry or inherit from an entry that defines it.","Spell the key exactly class_name (snake_case); verify YAML indentation places it inside the entry.","Schema-validate cassandra.yaml in CI with a JSON/YAML schema for memtable_configurations."],"tags":["cassandra","configuration","yaml","memtable"],"backgroundTag":"missing-required-config-field","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}