apache/cassandra · error · IllegalArgumentException

Invalid parameter list for fixed distribution:

Error message

Invalid parameter list for fixed distribution: 

What it means

cassandra-stress throws this when the 'fixed' distribution spec (e.g. FIX(1)) is given a parameter list whose size is not exactly 1. The Fixed distribution impl requires exactly one long value to return a constant. Any other arity, or a value that fails to parse as a long, is rejected as an IllegalArgumentException.

Solutions

  1. Pass exactly one numeric argument: -pop seq=FIX(10000)
  2. Remove extra comma-separated values; to get a range use seq distribution instead: SEQ(1..10000)
  3. Verify the value parses as a whole number (no suffixes, decimals, or quotes).

Example fix

// before
-fixed=FIX(1,2)
// after
-fixed=FIX(1)
Defensive patterns

Strategy: validation

Validate before calling

boolean isValidFixSpec(String s){ java.util.List<String> p = splitParams(s); if (p.size()!=1) return false; try { Long.parseLong(p.get(0)); return true; } catch (NumberFormatException e){ return false; } }

Try / catch

try { DistributionFactory f = OptionDistribution.get("FIX(" + v + ")"); } catch (IllegalArgumentException e) { log.error("Bad FIX spec: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Invoking cassandra-stress with a distribution spec like 'fixed' followed by zero, two or more parameters (e.g. 'FIX(1,2)' or 'FIX()'), or the params list missing entirely.

Common situations: Typing a comma-separated pair into a distribution that only takes one value; copying a Gaussian/Uniform spec style into FIX; extra whitespace causing the tokenizer to split args unexpectedly; passing a non-numeric token so parseLong fails.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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

Appendix: source

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

                final long max = parseLong(bounds[1]);
                if (min == max)
                    return new FixedFactory(min);
                return new UniformFactory(min, max);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params);
            }
        }
    }

    private static final class FixedImpl implements Impl
    {

        @Override
        public DistributionFactory getFactory(List<String> params)
        {
            if (params.size() != 1)
                throw new IllegalArgumentException("Invalid parameter list for fixed distribution: " + params);
            try
            {
                final long key = parseLong(params.get(0));
                return new FixedFactory(key);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for fixed distribution: " + params);
            }
        }
    }

    private static final class SequenceImpl implements Impl
    {

        @Override
        public DistributionFactory getFactory(List<String> params)
        {
            if (params.size() != 1)

View on GitHub (pinned to 88fd0f6a0e)