{"record":{"id":"4b9bed90a2162ca2","repo":"apache/cassandra","slug":"invalid-parameter-list-for-quantized-extreme-weib","errorCode":null,"errorMessage":"Invalid parameter list for quantized extreme (Weibull) distribution: ","messagePattern":"Invalid parameter list for quantized extreme \\(Weibull\\) distribution: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java","lineNumber":306,"sourceCode":"                WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);\n                // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,\n                // over entire range, but this results in overly skewed distribution, so take sqrt\n                final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));\n                return new ExtremeFactory(min, max, shape, scale);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for extreme (Weibull) distribution: \" + params);\n            }\n        }\n    }\n\n    private static final class QuantizedExtremeImpl implements Impl\n    {\n        @Override\n        public DistributionFactory getFactory(List<String> params)\n        {\n            if (params.size() != 3)\n                throw new IllegalArgumentException(\"Invalid parameter list for quantized extreme (Weibull) distribution: \" + params);\n            try\n            {\n                String[] bounds = params.get(0).split(\"\\\\.\\\\.+\");\n                final long min = parseLong(bounds[0]);\n                final long max = parseLong(bounds[1]);\n                final double shape = Double.parseDouble(params.get(1));\n                final int quantas = Integer.parseInt(params.get(2));\n                WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);\n                // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,\n                // over entire range, but this results in overly skewed distribution, so take sqrt\n                final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));\n                if (min == max)\n                    return new FixedFactory(min);\n                return new QuantizedExtremeFactory(min, max, shape, scale, quantas);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for quantized extreme (Weibull) distribution: \" + params);\n            }","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java#L288-L324","documentation":"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.","triggerScenarios":"Calling getFactory with fewer than 3 parameters (e.g. 'qextr(1..1000,2)' missing quantas) or more than 3 (extra trailing comma or argument).","commonSituations":"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.","solutions":["Supply exactly three parameters: QEXTREME(min..max,shape,quantas), e.g. QEXTREME(1..1000,2.5,10).","Remove any trailing or duplicate commas producing empty parameters.","Use EXTREME(min..max,shape) if quantization is not needed."],"exampleFix":"// before\nQEXTREME(1..1000, 2.5)\n// after\nQEXTREME(1..1000, 2.5, 10)","handlingStrategy":"validation","validationCode":"List<String> params = ...; // from QEXTREME(...)\nif (params.size() != 3)\n    throw new IllegalArgumentException(\"QEXTREME expects exactly 3 params min..max,shape,quantas, got \" + params);\nDouble.parseDouble(params.get(1));\nInteger.parseInt(params.get(2));","typeGuard":null,"tryCatchPattern":"try {\n    DistributionFactory f = quantizedExtremeImpl.getFactory(params);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"QEXTREME requires (min..max, shape, quantas): \" + e.getMessage());\n}","preventionTips":["QEXTREME/qextr requires all three parameters — never reuse plain EXTREME arity.","Validate quantas is an integer before calling getFactory.","Watch for trailing commas when building specs from templates."],"tags":["cassandra","cli","argument-count","distribution"],"backgroundTag":"invalid-cli-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}