apache/cassandra · error · IllegalArgumentException

Invalid parameter list for quantized extreme (Weibull) distr

Error message

Invalid parameter list for quantized extreme (Weibull) distribution: 

What it means

QuantizedExtremeImpl.getFactory() parses QEXTREME(min..max,shape,quantas) specs and throws IllegalArgumentException when the parameter list does not contain exactly 3 entries. All three — range, Weibull shape, and quantization count — are required.

Source

Thrown at tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:306

                WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);
                // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
                // over entire range, but this results in overly skewed distribution, so take sqrt
                final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
                return new ExtremeFactory(min, max, shape, scale);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
            }
        }
    }

    private static final class QuantizedExtremeImpl implements Impl
    {
        @Override
        public DistributionFactory getFactory(List<String> params)
        {
            if (params.size() != 3)
                throw new IllegalArgumentException("Invalid parameter list for quantized extreme (Weibull) distribution: " + params);
            try
            {
                String[] bounds = params.get(0).split("\\.\\.+");
                final long min = parseLong(bounds[0]);
                final long max = parseLong(bounds[1]);
                final double shape = Double.parseDouble(params.get(1));
                final int quantas = Integer.parseInt(params.get(2));
                WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);
                // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
                // over entire range, but this results in overly skewed distribution, so take sqrt
                final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
                if (min == max)
                    return new FixedFactory(min);
                return new QuantizedExtremeFactory(min, max, shape, scale, quantas);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for quantized extreme (Weibull) distribution: " + params);
            }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Supply exactly three parameters: QEXTREME(min..max,shape,quantas), e.g. QEXTREME(1..1000,2.5,10).
  2. Remove any trailing or duplicate commas producing empty parameters.
  3. Use EXTREME(min..max,shape) if quantization is not needed.

Example fix

// before
QEXTREME(1..1000, 2.5)
// after
QEXTREME(1..1000, 2.5, 10)
Defensive patterns

Strategy: validation

Validate before calling

List<String> params = ...; // from QEXTREME(...)
if (params.size() != 3)
    throw new IllegalArgumentException("QEXTREME expects exactly 3 params min..max,shape,quantas, got " + params);
Double.parseDouble(params.get(1));
Integer.parseInt(params.get(2));

Try / catch

try {
    DistributionFactory f = quantizedExtremeImpl.getFactory(params);
} catch (IllegalArgumentException e) {
    System.err.println("QEXTREME requires (min..max, shape, quantas): " + e.getMessage());
}

Prevention

When it happens

Trigger: Calling getFactory with fewer than 3 parameters (e.g. 'qextr(1..1000,2)' missing quantas) or more than 3 (extra trailing comma or argument).

Common situations: Users copying plain EXTREME (2-param) syntax for the quantized alias 'qextr'/'qextreme', or a trailing comma in a hand-edited stress profile yielding an empty 4th parameter.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


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