{"record":{"id":"84a872d8157d628f","repo":"apache/hadoop","slug":"the-bucket-size-in-the-rolling-window-is-not-integ","errorCode":null,"errorMessage":"The bucket size in the rolling window is not integer: windowLenMs= {} numBuckets= {}","messagePattern":"The bucket size in the rolling window is not integer: windowLenMs= (.+?) numBuckets= (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindow.java","lineNumber":80,"sourceCode":"   */\n  Bucket[] buckets;\n  final int windowLenMs;\n  final int bucketSize;\n\n  /**\n   * @param windowLenMs The period that is covered by the window. This period must\n   *          be more than the buffering delays.\n   * @param numBuckets number of buckets in the window\n   */\n  RollingWindow(int windowLenMs, int numBuckets) {\n    buckets = new Bucket[numBuckets];\n    for (int i = 0; i < numBuckets; i++) {\n      buckets[i] = new Bucket();\n    }\n    this.windowLenMs = windowLenMs;\n    this.bucketSize = windowLenMs / numBuckets;\n    if (this.windowLenMs % numBuckets != 0) {\n      throw new IllegalArgumentException(\n          \"The bucket size in the rolling window is not integer: windowLenMs= \"\n              + windowLenMs + \" numBuckets= \" + numBuckets);\n    }\n  }\n\n  /**\n   * When an event occurs at the specified time, this method reflects that in\n   * the rolling window.\n   * <p>\n   *\n   * @param time the time at which the event occurred\n   * @param delta the delta that will be added to the window\n   */\n  public void incAt(long time, long delta) {\n    int bi = computeBucketIndex(time);\n    Bucket bucket = buckets[bi];\n    // If the last time the bucket was updated is out of the scope of the\n    // rolling window, reset the bucket.","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindow.java#L62-L98","documentation":"Error \"The bucket size in the rolling window is not integer: windowLenMs= {} numBuckets= {}\" thrown in apache/hadoop.","triggerScenarios":"The top rolling window is configured with a window length not divisible by the bucket count.","commonSituations":"Setting dfs.namenode.top.window.num.buckets and window length to incompatible values.","solutions":["Choose a rolling window length that divides evenly into the configured number of buckets (windowLenMs % numBuckets == 0)."],"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"}