apache/cassandra · error · IllegalArgumentException

Invalid parameter list for sequence distribution:

Error message

Invalid parameter list for sequence distribution: 

What it means

The sequence distribution impl (SEQ(min..max)) requires exactly one parameter containing a 'min..max' range. This throw happens when the params list size is not 1, i.e. the sequence spec was passed zero or multiple parameter tokens.

Solutions

  1. Quote the spec so the shell passes it as one token: -pop 'seq=SEQ(1..1000000)'
  2. Provide the range inside parentheses with .. separator: SEQ(min..max)
  3. Check for stray spaces inside the spec that tokenize it into multiple params.

Example fix

// before
-pop seq=SEQ(1 ..1000)   # splits into multiple params
// after
-pop seq=SEQ(1..1000)
Defensive patterns

Strategy: validation

Validate before calling

boolean isValidSeqSpec(String s){ if (s.chars().filter(c==',').count()!=0) ...; return s.matches(".*\\(\\s*-?\\d+\\.\\.-?\\d+\\s*\\)"); }

Try / catch

try { DistributionFactory f = seq.getFactory(params); } catch (IllegalArgumentException e) { reportSpecError(e); }

Prevention

When it happens

Trigger: cassandra-stress invoked with a seq distribution spec whose parameter list has zero or more than one element, e.g. 'SEQ()' or the range string split into separate args.

Common situations: Shell splitting the '..' range into two tokens; forgetting the parentheses entirely; mixing sequence with fixed-style single-value syntax.

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

Appendix: source

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

            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)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution: " + params);
            final long min;
            final long max;
            try
            {
                String[] bounds = params.get(0).split("\\.\\.+");
                min = parseLong(bounds[0]);
                max = parseLong(bounds[1]);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution: " + params);
            }
            if (min == max)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution (min==max): " + params);

            if (min > max)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution (min>max): " + params);

            return new SequenceFactory(min, max);

View on GitHub (pinned to 88fd0f6a0e)