{"record":{"id":"d79acb158a98c7d2","repo":"apache/hadoop","slug":"err","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/SimulatedDataNodes.java","lineNumber":83,"sourceCode":" */\npublic class SimulatedDataNodes extends Configured implements Tool {\n\n  // Set this arbitrarily large (100TB) since we don't care about storage\n  // capacity\n  private static final long STORAGE_CAPACITY = 100 * 2L << 40;\n  private static final String USAGE = \"Usage: \"\n      + \"org.apache.hadoop.tools.dynamometer.SimulatedDataNodes \"\n      + \"bpid blockListFile1 [ blockListFileN ... ]\\n\"\n      + \"   bpid should be the ID of the block pool to which these DataNodes \"\n      + \"belong.\\n\"\n      + \"   Each blockListFile specified should contain a list of blocks to \"\n      + \"be served by one DataNode.\\n\"\n      + \"   See the Javadoc of this class for more detail.\";\n\n  static void printUsageExit(String err) {\n    System.out.println(err);\n    System.out.println(USAGE);\n    throw new RuntimeException(err);\n  }\n\n  public static void main(String[] args) throws Exception {\n    SimulatedDataNodes datanodes = new SimulatedDataNodes();\n    ToolRunner.run(new HdfsConfiguration(), datanodes, args);\n  }\n\n  public int run(String[] args) throws Exception {\n    if (args.length < 2) {\n      printUsageExit(\"Not enough arguments\");\n    }\n    String bpid = args[0];\n    List<Path> blockListFiles = new ArrayList<>();\n    for (int i = 1; i < args.length; i++) {\n      blockListFiles.add(new Path(args[i]));\n    }\n\n    URI defaultFS = FileSystem.getDefaultUri(getConf());","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/SimulatedDataNodes.java#L65-L101","documentation":"SimulatedDataNodes.printUsageExit() prints the offending message, prints the USAGE text, then rethrows the message as a RuntimeException, terminating the tool. The main producer is run(): 'Not enough arguments' when fewer than 2 command line args are given. The message text you see is whatever err was passed in.","triggerScenarios":"Launching org.apache.hadoop.tools.dynamometer.SimulatedDataNodes with 0 or 1 arguments. The tool requires args[0] = block pool id (bpid) and args[1..N] = block listing files, one per simulated DataNode, so args.length < 2 always lands here.","commonSituations":"Forgetting the bpid in a wrapper script, or a shell glob for the block list files expanding to zero files so only the bpid survives.","solutions":["Invoke as: hadoop jar ... SimulatedDataNodes <bpid> <blockListFile1> [blockListFile2 ...]","Verify globs for the block list files expand to at least one existing file before the call","Check that a preceding option parser is not swallowing the positional arguments"],"exampleFix":"# before\nSimulatedDataNodes bp-123\n# after: bpid plus at least one block list file\nSimulatedDataNodes bp-123 /tmp/blocks/dn0.out /tmp/blocks/dn1.out","handlingStrategy":"validation","validationCode":"if (args.length < 2) {\n  System.err.println(\"usage: SimulatedDataNodes <bpid> <blockListFile...>\");\n  System.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap the tool in a script that checks arg count and file existence first","Use 'set -u' in bash so unset variables/globs fail early"],"tags":["dynamometer","cli","usage","arguments"],"backgroundTag":"missing-command-line-arguments","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}