{"record":{"id":"6ce2acacd19481b8","repo":"apache/hadoop","slug":"error-instantiating-reservedspacecalculator","errorCode":null,"errorMessage":"Error instantiating ReservedSpaceCalculator","messagePattern":"Error instantiating ReservedSpaceCalculator","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReservedSpaceCalculator.java","lineNumber":84,"sourceCode":"    public Builder setDir(String newDir) {\n      this.dir = newDir;\n      return this;\n    }\n\n    ReservedSpaceCalculator build() {\n      try {\n        Class<? extends ReservedSpaceCalculator> clazz = conf.getClass(\n            DFS_DATANODE_DU_RESERVED_CALCULATOR_KEY,\n            DFS_DATANODE_DU_RESERVED_CALCULATOR_DEFAULT,\n            ReservedSpaceCalculator.class);\n\n        Constructor constructor = clazz.getConstructor(\n            Configuration.class, DF.class, StorageType.class, String.class);\n\n        return (ReservedSpaceCalculator) constructor.newInstance(\n            conf, usage, storageType, dir);\n      } catch (Exception e) {\n        throw new IllegalStateException(\n            \"Error instantiating ReservedSpaceCalculator\", e);\n      }\n    }\n  }\n\n  private final DF usage;\n  private final Configuration conf;\n  private final StorageType storageType;\n\n  private final String dir;\n\n  ReservedSpaceCalculator(Configuration conf, DF usage,\n      StorageType storageType, String dir) {\n    this.usage = usage;\n    this.conf = conf;\n    this.storageType = storageType;\n    this.dir = dir;\n  }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReservedSpaceCalculator.java#L66-L102","documentation":"Error \"Error instantiating ReservedSpaceCalculator\" thrown in apache/hadoop.","triggerScenarios":"DataNode startup when the configured dfs.datanode.du.reserved calculator class cannot be instantiated (missing class, bad constructor, config error).","commonSituations":"See trigger scenarios.","solutions":["Check the configured ReservedSpaceCalculator class name (dfs.datanode.reserved.space.calculator) for typos and ensure the class is on the DataNode classpath.","Review the DataNode log for the reflection/constructor error and fix the custom calculator implementation."],"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-23T01:17:44.959Z"}