{"record":{"id":"c24319ff020116d1","repo":"apache/druid","slug":"non-unique-bitmapfullnessfactorizationstops","errorCode":null,"errorMessage":"Non unique bitmapFullnessFactorizationStops: ","messagePattern":"Non unique bitmapFullnessFactorizationStops: ","errorType":"validation","errorClass":"RE","httpStatus":null,"severity":"critical","filePath":"processing/src/main/java/org/apache/druid/segment/BitmapOffset.java","lineNumber":59,"sourceCode":"  private static final int INVALID_VALUE = -1;\n\n  /**\n   * Currently the default stops are not consciously optimized for the goals described in {@link #factorizeFullness}.\n   * They are chosen intuitively. There was no experimentation with different bitmapFullnessFactorizationStops.\n   * Experimentation and performance feedback with a different set of stops is welcome.\n   */\n  private static final String DEFAULT_FULLNESS_FACTORIZATION_STOPS = \"0.01,0.1,0.3,0.5,0.7,0.9,0.99\";\n  private static final double[] BITMAP_FULLNESS_FACTORIZATION_STOPS;\n  private static final String[] FACTORIZED_FULLNESS;\n\n  static {\n    String stopString = System.getProperty(\"bitmapFullnessFactorizationStops\", DEFAULT_FULLNESS_FACTORIZATION_STOPS);\n    String[] stopsArray = stopString.split(\",\");\n    if (stopsArray.length == 0) {\n      throw new RE(\"Empty bitmapFullnessFactorizationStops: \" + stopString);\n    }\n    if (new HashSet<>(Arrays.asList(stopsArray)).size() != stopsArray.length) {\n      throw new RE(\"Non unique bitmapFullnessFactorizationStops: \" + stopString);\n    }\n\n    BITMAP_FULLNESS_FACTORIZATION_STOPS = new double[stopsArray.length];\n    for (int i = 0; i < stopsArray.length; i++) {\n      String stop = stopsArray[i];\n      BITMAP_FULLNESS_FACTORIZATION_STOPS[i] = Double.parseDouble(stop);\n\n    }\n    Arrays.sort(BITMAP_FULLNESS_FACTORIZATION_STOPS);\n\n    double firstStop = BITMAP_FULLNESS_FACTORIZATION_STOPS[0];\n    if (Double.isNaN(firstStop) || firstStop <= 0.0) {\n      throw new RE(\"First bitmapFullnessFactorizationStop[%d] should be > 0\", firstStop);\n    }\n    double lastStop = BITMAP_FULLNESS_FACTORIZATION_STOPS[stopsArray.length - 1];\n    if (Double.isNaN(lastStop) || lastStop >= 1) {\n      throw new RE(\"Last bitmapFullnessFactorizationStop[%d] should be < 1\", lastStop);\n    }","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/BitmapOffset.java#L41-L77","documentation":"The static initializer of BitmapOffset validates that the comma-separated bitmapFullnessFactorizationStops system property contains unique values. If the parsed stop list has duplicates (set size differs from array length), it throws RE 'Non unique bitmapFullnessFactorizationStops: ' echoing the raw string. This happens once per JVM at class initialization.","triggerScenarios":"Launching a Druid process with -DbitmapFullnessFactorizationStops containing a repeated value, e.g. '0.2,0.5,0.2' — detected by comparing HashSet size to array length in the static block.","commonSituations":"Hand-edited jvm.config tuning values that duplicate a stop; scripted config generation appending a default stop that already exists in a custom list; typo'd copies of the default stop list.","solutions":["Edit jvm.config to remove the duplicated stop so all values are distinct.","Use the default by deleting the -DbitmapFullnessFactorizationStops flag.","Deduplicate the generated list in the config script (e.g. sort -u) before injecting it into JVM args.","Restart the service after the fix; the exception aborts class loading."],"exampleFix":"// before\n-DbitmapFullnessFactorizationStops=0.2,0.5,0.2\n// after\n-DbitmapFullnessFactorizationStops=0.2,0.5,0.8","handlingStrategy":"validation","validationCode":"String[] stops = prop.split(\",\");\nif (new HashSet<>(Arrays.asList(stops)).size() != stops.length) {\n  throw new IllegalStateException(\"duplicate bitmapFullnessFactorizationStops\");\n}","typeGuard":"boolean uniqueStops(String prop) {\n  String[] s = prop.split(\",\");\n  return new HashSet<>(Arrays.asList(s)).size() == s.length;\n}","tryCatchPattern":"try {\n  config.validateBitmapStops();\n} catch (RuntimeException e) {\n  log.error(e, \"invalid bitmapFullnessFactorizationStops, falling back to default\");\n}","preventionTips":["Deduplicate stop lists in config generation scripts","Never hand-append a default stop to a custom list without checking","Peer-review jvm.config tuning changes","Validate the property in startup scripts before launching the JVM"],"tags":["java","jvm-properties","static-init","bitmap","duplicate-config"],"backgroundTag":"invalid-config-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}