apache/cassandra · error · java.lang.IllegalArgumentException

<ConfigurationException message>

Error message

<ConfigurationException message>

What it means

setCompressionParameters applies new compression parameters as a local schema override. If the parameters are invalid, the underlying ConfigurationException (e.g. unknown compressor class or bad chunk length) is converted to an IllegalArgumentException carrying the ConfigurationException's message.

Source

Thrown at src/java/org/apache/cassandra/db/ColumnFamilyStore.java:479

    public String getCompressionParametersJson()
    {
        return JsonUtils.writeAsJsonString(getCompressionParameters());
    }

    public void setCompressionParameters(Map<String,String> opts)
    {
        try
        {
            CompressionParams params = CompressionParams.fromMap(opts);
            params.validate();

            TableMetadata orig = metadata();
            metadata.setLocalOverrides(orig.unbuild().compression(params).epoch(orig.epoch).build());
        }
        catch (ConfigurationException e)
        {
            throw new IllegalArgumentException(e.getMessage());
        }
    }

    public void setCompressionParametersJson(String options)
    {
        setCompressionParameters(JsonUtils.fromJsonMap(options));
    }

    @VisibleForTesting
    public ColumnFamilyStore(Keyspace keyspace,
                             String columnFamilyName,
                             Supplier<? extends SSTableId> sstableIdGenerator,
                             TableMetadata initMetadata,
                             Directories directories,
                             boolean loadSSTables,
                             boolean registerBookeeping)
    {
        this(keyspace, columnFamilyName, sstableIdGenerator, initMetadata, directories, loadSSTables, registerBookeeping, true);

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Fix the compressor class name (use org.apache.cassandra.io.compress.* fully qualified names as needed)
  2. Verify the compressor library is available in this Cassandra version's classpath
  3. Use valid option values (e.g. chunk_length_kb within the allowed range, like 4-64)
  4. Retry setcompressionparameters with corrected options

Example fix

// before
nodetool setcompressionparameters ks t '{"class":"LZ4Compressor","chunk_length_kb":"4k"}'
// after
nodetool setcompressionparameters ks t '{"class":"org.apache.cassandra.io.compress.LZ4Compressor","chunk_length_kb":"16"}'
Defensive patterns

Strategy: try-catch

Validate before calling

// verify compressor availability
try { Class.forName("org.apache.cassandra.io.compress.LZ4Compressor"); } catch (ClassNotFoundException e) { /* unsupported compressor */ }
if (chunkLengthKb < 4 || chunkLengthKb > 64) throw new IllegalArgumentException("chunk_length_kb out of range");

Try / catch

try { cfs.setCompressionParameters(params); } catch (IllegalArgumentException e) { /* message is the underlying ConfigurationException text; correct params and retry */ }

Prevention

When it happens

Trigger: Calling setCompressionParameters (via JMX/nodetool setcompressionparameters or setCompressionParametersJson) with a compressor class that cannot be loaded or configured, or an invalid chunk_length_kb / other option value.

Common situations: Typo in compression class name, using a compressor not on the classpath (e.g. Zstd on older versions), chunk length outside the allowed range, wrong JSON types in options map.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/154de086399948d4. Report an issue: GitHub.