You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/07/18 09:37:00 UTC

[iotdb] branch rel/0.13 updated: [To rel/0.13][IOTDB-3858] IndexOutOfBoundsException: bitIndex < 0 (#6697)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new d844efbb61 [To rel/0.13][IOTDB-3858] IndexOutOfBoundsException: bitIndex < 0  (#6697)
d844efbb61 is described below

commit d844efbb61a2102613522937f037c3870e9cb194
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Mon Jul 18 17:36:55 2022 +0800

    [To rel/0.13][IOTDB-3858] IndexOutOfBoundsException: bitIndex < 0  (#6697)
---
 .../src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
index 4117a5fa7d..36a4fcdf09 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
@@ -160,7 +160,12 @@ public class BloomFilter {
     }
 
     public int hash(String value) {
-      return Math.abs(Murmur128Hash.hash(value, seed)) % cap;
+      int res = Murmur128Hash.hash(value, seed);
+      if (res == Integer.MIN_VALUE) {
+        res = 0;
+      }
+
+      return Math.abs(res) % cap;
     }
 
     @Override