apache/cassandra · error · IllegalArgumentException

Invalid parameter list for gaussian distribution:

Error message

Invalid parameter list for gaussian distribution: 

What it means

In Apache Cassandra's cassandra-stress tool, OptionDistribution's GaussianImpl.getFactory() validates the argument count of a GAUSSIAN(...) distribution spec. It throws IllegalArgumentException when the parameter list has fewer than 1 or more than 3 entries. Valid forms are GAUSSIAN(min..max), GAUSSIAN(min..max,stdvrng) and GAUSSIAN(min..max,mean,stdev).

Source

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

            case 'b':
                multiplier *= 1000;
            case 'm':
                multiplier *= 1000;
            case 'k':
                multiplier *= 1000;
                value = value.substring(0, value.length() - 1);
        }
        return Long.parseLong(value) * multiplier;
    }

    private static final class GaussianImpl implements Impl
    {

        @Override
        public DistributionFactory getFactory(List<String> params)
        {
            if (params.size() > 3 || params.size() < 1)
                throw new IllegalArgumentException("Invalid parameter list for gaussian distribution: " + params);
            try
            {
                String[] bounds = params.get(0).split("\\.\\.+");
                final long min = parseLong(bounds[0]);
                final long max = parseLong(bounds[1]);
                final double mean, stdev;
                if (params.size() == 3)
                {
                    mean = Double.parseDouble(params.get(1));
                    stdev = Double.parseDouble(params.get(2));
                }
                else
                {
                    final double stdevsToEdge = params.size() == 1 ? 3d : Double.parseDouble(params.get(1));
                    mean = (min + max) / 2d;
                    stdev = ((max - min) / 2d) / stdevsToEdge;
                }
                if (min == max)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Pass exactly 1, 2, or 3 parameters: GAUSSIAN(min..max), GAUSSIAN(min..max,stdvrng), or GAUSSIAN(min..max,mean,stdev).
  2. Remove empty or trailing commas from the distribution spec (e.g. 'GAUSSIAN(1..1000,3,)' -> 'GAUSSIAN(1..1000,3)').
  3. Check shell/script variable expansion is not producing an empty or duplicated argument inside the parentheses.

Example fix

// before
dist = GAUSSIAN(1..1000, 500, 100, 5)
// after
dist = GAUSSIAN(1..1000, 500, 100)
Defensive patterns

Strategy: validation

Validate before calling

List<String> params = ...; // e.g. from GAUSSIAN(...)
if (params.size() < 1 || params.size() > 3)
    throw new IllegalArgumentException("GAUSSIAN expects 1-3 params: GAUSSIAN(min..max[,stdvrng|(mean,stdev)]), got " + params);

Try / catch

try {
    DistributionFactory f = new OptionDistribution("", "", false).getImpl("gaussian").getFactory(params);
} catch (IllegalArgumentException e) {
    System.err.println("Bad distribution spec: " + e.getMessage() + " — see 'cassandra-stress help'");
}

Prevention

When it happens

Trigger: Calling getFactory with an empty params list (e.g. 'gaussian()' or 'gauss' with no argument), or with 4+ comma-separated parameters (e.g. 'gaussian(1..1000,500,10,extra)').

Common situations: Typing extra commas in a cassandra-stress -pop or cl/spec option (e.g. 'GAUSSIAN(1..100,3,)'), passing an empty distribution spec from a script variable that expanded to nothing, or hand-editing a stress profile and leaving a trailing comma.

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/4f28cc8e03113510. Report an issue: GitHub.