{"record":{"id":"8e38692b038f03a7","repo":"apache/hadoop","slug":"hashtype-must-be-known","errorCode":null,"errorMessage":"hashType must be known","messagePattern":"hashType must be known","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java","lineNumber":96,"sourceCode":"   * Builds a hash function that must obey to a given maximum number of returned values and a highest value.\n   * @param maxValue The maximum highest returned value.\n   * @param nbHash The number of resulting hashed values.\n   * @param hashType type of the hashing function (see {@link Hash}).\n   */\n  public HashFunction(int maxValue, int nbHash, int hashType) {\n    if (maxValue <= 0) {\n      throw new IllegalArgumentException(\"maxValue must be > 0\");\n    }\n    \n    if (nbHash <= 0) {\n      throw new IllegalArgumentException(\"nbHash must be > 0\");\n    }\n\n    this.maxValue = maxValue;\n    this.nbHash = nbHash;\n    this.hashFunction = Hash.getInstance(hashType);\n    if (this.hashFunction == null)\n      throw new IllegalArgumentException(\"hashType must be known\");\n  }\n\n  /** Clears <i>this</i> hash function. A NOOP */\n  public void clear() {\n  }\n\n  /**\n   * Hashes a specified key into several integers.\n   * @param k The specified key.\n   * @return The array of hashed values.\n   */\n  public int[] hash(Key k){\n      byte[] b = k.getBytes();\n      if (b == null) {\n        throw new NullPointerException(\"buffer reference is null\");\n      }\n      if (b.length == 0) {\n        throw new IllegalArgumentException(\"key length must be > 0\");","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java#L78-L114","documentation":"Error \"hashType must be known\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["hashType must be a known constant (JENKINS_HASH or MURMUR_HASH). Pass one of the HashFunction hash type constants instead of an arbitrary integer."],"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"}