{"record":{"id":"833f37ef62946d37","repo":"apache/hadoop","slug":"compression-ratio-should-be-in-the-range-0-07-0-6","errorCode":null,"errorMessage":"Compression ratio should be in the range [0.07,0.68]. Configured compression ratio is {}.","messagePattern":"Compression ratio should be in the range \\[0\\.07,0\\.68\\]\\. Configured compression ratio is (.+?)\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/CompressionEmulationUtil.java","lineNumber":258,"sourceCode":"      map.put(.65F,1355);\n      map.put(.66F,1510);\n      map.put(.67F,1805);\n      map.put(.68F,2170);\n    }\n    \n    /**\n     * Returns the size of the word in {@link RandomTextDataGenerator}'s \n     * dictionary that can generate text with the desired compression ratio.\n     * \n     * @throws RuntimeException If ratio is less than {@value #MIN_RATIO} or \n     *                          greater than {@value #MAX_RATIO}.\n     */\n    int getWordSizeForRatio(float ratio) {\n      ratio = standardizeCompressionRatio(ratio);\n      if (ratio >= MIN_RATIO && ratio <= MAX_RATIO) {\n        return map.get(ratio);\n      } else {\n        throw new RuntimeException(\"Compression ratio should be in the range [\" \n          + MIN_RATIO + \",\" + MAX_RATIO + \"]. Configured compression ratio is \" \n          + ratio + \".\");\n      }\n    }\n  }\n  \n  /**\n   * Setup the data generator's configuration to generate compressible random \n   * text data with the desired compression ratio.\n   * Note that the compression ratio, if configured, will set the \n   * {@link RandomTextDataGenerator}'s list-size and word-size based on \n   * empirical values using the compression ratio set in the configuration. \n   * \n   * Hence to achieve the desired compression ratio, \n   * {@link RandomTextDataGenerator}'s list-size will be set to the default \n   * value i.e {@value RandomTextDataGenerator#DEFAULT_LIST_SIZE}.\n   */\n  static void setupDataGeneratorConfig(Configuration conf) {","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/CompressionEmulationUtil.java#L240-L276","documentation":"Error \"Compression ratio should be in the range [0.07,0.68]. Configured compression ratio is {}.\" thrown in apache/hadoop.","triggerScenarios":"gridmix.compression-emulation.ratio is configured outside the supported range [0.07, 0.68], so Gridmix cannot emulate compression for the generated data.","commonSituations":"See trigger scenarios.","solutions":["Set mapreduce.gridmix.compression-emulation.ratio (compression ratio) to a value within [0.07, 0.68]."],"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"}