{"record":{"id":"533d5b76ef4922a4","repo":"apache/cassandra","slug":"use-the-d-flag-to-quiet-this-error-and-get-the-ex-533d5b","errorCode":null,"errorMessage":"Use the -d flag to quiet this error and get the exact throughput in megabits/s","messagePattern":"Use the -d flag to quiet this error and get the exact throughput in megabits/s","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java","lineNumber":81,"sourceCode":"\n        }\n        else if (interDCStreamThroughputDoubleMbit)\n        {\n            throughputInDouble = probe.getInterDCStreamThroughputAsDouble();\n            probe.output().out.printf(\"Current stream throughput: %s%n\",\n                                      throughputInDouble > 0 ? throughputInDouble + \" Mb/s\" : \"unlimited\");\n        }\n        else\n        {\n            throughputInDouble = probe.getInterDCStreamThroughputAsDouble();\n            throughput = probe.getInterDCStreamThroughput();\n\n            if (throughput <= 0)\n                probe.output().out.printf(\"Current inter-datacenter stream throughput: unlimited%n\");\n            else if (DoubleMath.isMathematicalInteger(throughputInDouble))\n                probe.output().out.printf(throughputInDouble + \"Current inter-datacenter stream throughput: %s%n\", throughput + \" Mb/s\");\n            else\n                throw new RuntimeException(\"Use the -d flag to quiet this error and get the exact throughput in megabits/s\");\n        }\n    }\n}\n","sourceCodeStart":63,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java#L63-L85","documentation":"When printing the default inter-DC stream throughput (Mbit), GetInterDCStreamThroughput refuses to round a fractional value: if throughputInDouble is not a mathematical integer and -d was not passed, it throws this RuntimeException directing the user to -d for the exact value.","triggerScenarios":"Running `nodetool getinterdcstreamthroughput` (no -d) when stream_throughput_outbound_megabits_per_sec (inter-DC variant) is configured as a fraction, e.g. 195.5.","commonSituations":"Fractional throughput tuning values set in cassandra.yaml; monitoring scripts that invoke the command without -d and crash.","solutions":["Run `nodetool getinterdcstreamthroughput -d` for the exact double","Change the inter-DC stream throughput setting to a whole number","Update automation to pass -d"],"exampleFix":"// before\nnodetool getinterdcstreamthroughput\n// after\nnodetool getinterdcstreamthroughput -d","handlingStrategy":"validation","validationCode":"nodetool getinterdcstreamthroughput -d","typeGuard":null,"tryCatchPattern":"try { run(); } catch (RuntimeException e) { if (e.getMessage().contains(\"-d flag\")) runWithDouble(); }","preventionTips":["Use -d in monitoring scripts","Set whole-number inter-DC stream throughput values","Handle fractional values in output parsers"],"tags":["nodetool","cli","throughput"],"backgroundTag":"invalid-flag-value","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"}