{"record":{"id":"1bb3f2e25f136212","repo":"apache/cassandra","slug":"you-cannot-use-e-and-m-at-the-same-time","errorCode":null,"errorMessage":"You cannot use -e and -m at the same time","messagePattern":"You cannot use -e and -m at the same time","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java","lineNumber":42,"sourceCode":"import picocli.CommandLine.Parameters;\n\n@Command(name = \"setinterdcstreamthroughput\", description = \"Set the throughput cap for inter-datacenter streaming and entire SSTable inter-datacenter streaming in the system, or 0 to disable throttling\")\npublic class SetInterDCStreamThroughput extends AbstractCommand\n{\n    @Parameters(paramLabel = \"inter_dc_stream_throughput\", description = \"Value in megabits, 0 to disable throttling\", arity = \"1\")\n    private int interDCStreamThroughput;\n\n    @Option(names = { \"-e\", \"--entire-sstable-throughput\" }, description = \"Set entire SSTable streaming throughput in MiB/s\")\n    private boolean setEntireSSTableThroughput;\n\n    @Option(names = { \"-m\", \"--mib\" }, description = \"Set streaming throughput in MiB/s\")\n    private boolean interDCStreamThroughputInMebibytes;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        if (setEntireSSTableThroughput && interDCStreamThroughputInMebibytes)\n            throw new IllegalArgumentException(\"You cannot use -e and -m at the same time\");\n\n        if (setEntireSSTableThroughput)\n            probe.setEntireSSTableInterDCStreamThroughput(interDCStreamThroughput);\n        else if (interDCStreamThroughputInMebibytes )\n            probe.setInterDCStreamThroughputMiB(interDCStreamThroughput);\n        else\n            probe.setInterDCStreamThroughput(interDCStreamThroughput);\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java#L24-L52","documentation":"nodetool setinterdcstreamthroughput accepts -e/-entire-sstable (entire-SSTable throughput) and -m/-mebibytes (MiB units) as separate flags, but they are mutually exclusive because each selects a different setter on NodeProbe. Passing both is ambiguous, so execute() throws IllegalArgumentException before applying anything.","triggerScenarios":"Running `nodetool setinterdcstreamthroughput -e -m 50 100` where both setEntireSSTableThroughput and interDCStreamThroughputInMebibytes are true.","commonSituations":"Users combining documentation examples for the MiB-based and entire-SSTable-based variants of the command in one invocation.","solutions":["Remove either -e or -m from the command line.","Use -e alone to set entire-SSTable throughput, or -m alone for MiB-based throughput.","Run `nodetool help setinterdcstreamthroughput` to confirm flag semantics."],"exampleFix":"// before\nnodetool setinterdcstreamthroughput -e -m 50\n// after\nnodetool setinterdcstreamthroughput -m 50","handlingStrategy":"validation","validationCode":"if (args.includes('-e') && args.includes('-m')) throw new Error('Use -e or -m, not both');","typeGuard":null,"tryCatchPattern":"try { probe.execute(); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"-e and -m\")) fixFlagsAndRetry(); else throw e; }","preventionTips":["Never combine -e and -m in generated commands","Validate flag sets in wrapper scripts before invoking nodetool"],"tags":["nodetool","cli","mutually-exclusive"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}