{"record":{"id":"640b6ed132454c8e","repo":"apache/hadoop","slug":"cannot-add-child-to-machinenode","errorCode":null,"errorMessage":"Cannot add child to MachineNode","messagePattern":"Cannot add child to MachineNode","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/MachineNode.java","lineNumber":108,"sourceCode":"   * @return the number of cores of the node.\n   */\n  public int getNumCores() {\n    return numCores;\n  }\n\n  /**\n   * Get the rack node that the machine belongs to.\n   * \n   * @return The rack node that the machine belongs to. Returns null if the\n   *         machine does not belong to any rack.\n   */\n  public RackNode getRackNode() {\n    return (RackNode)getParent();\n  }\n  \n  @Override\n  public synchronized boolean addChild(Node child) {\n    throw new IllegalStateException(\"Cannot add child to MachineNode\");\n  }\n\n  /**\n   * Builder for a NodeInfo object\n   */\n  public static final class Builder {\n    private MachineNode node;\n    \n    /**\n     * Start building a new NodeInfo object.\n     * @param name\n     *          Unique name of the node. Typically the fully qualified domain\n     *          name.\n     */\n    public Builder(String name, int level) {\n      node = new MachineNode(name, level);\n    }\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/MachineNode.java#L90-L126","documentation":"Error \"Cannot add child to MachineNode\" thrown in apache/hadoop.","triggerScenarios":"Code attempts to add a child node to a MachineNode in a Rumen topology; machine nodes are leaves and cannot have children.","commonSituations":"See trigger scenarios.","solutions":["Only add leaf task nodes under a MachineNode's parent structure; MachineNode is a leaf and cannot have children."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}