This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new fd61e74 upgrade roaringbitmap to 0.8.0 (#4087)
fd61e74 is described below
commit fd61e745db4e91133c75a24b7c3d7e911f0ab6ac
Author: Xue Yu <[email protected]>
AuthorDate: Sat Apr 13 05:10:59 2019 +0800
upgrade roaringbitmap to 0.8.0 (#4087)
---
.../apache/pinot/core/operator/docidsets/BitmapDocIdSet.java | 5 +----
.../pinot/core/common/docidsets/BitmapDocIdSetTest.java | 12 +++++-------
pom.xml | 2 +-
3 files changed, 7 insertions(+), 12 deletions(-)
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/operator/docidsets/BitmapDocIdSet.java
b/pinot-core/src/main/java/org/apache/pinot/core/operator/docidsets/BitmapDocIdSet.java
index ae469ff..b1936a1 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/operator/docidsets/BitmapDocIdSet.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/operator/docidsets/BitmapDocIdSet.java
@@ -40,10 +40,7 @@ public class BitmapDocIdSet implements FilterBlockDocIdSet {
_bitmap = orBitmap;
} else if (numBitmaps == 1) {
if (exclusive) {
- // NOTE: cannot use ImmutableRoaringBitmap.flip() because the library
has a bug in that method
- // TODO: the bug has been fixed in the latest version of
ImmutableRoaringBitmap, update the version
- MutableRoaringBitmap bitmap = bitmaps[0].toMutableRoaringBitmap();
- bitmap.flip(startDocId, endDocId + 1);
+ MutableRoaringBitmap bitmap = ImmutableRoaringBitmap.flip(bitmaps[0],
startDocId, endDocId + 1);
_bitmap = bitmap;
} else {
_bitmap = bitmaps[0];
diff --git
a/pinot-core/src/test/java/org/apache/pinot/core/common/docidsets/BitmapDocIdSetTest.java
b/pinot-core/src/test/java/org/apache/pinot/core/common/docidsets/BitmapDocIdSetTest.java
index 2926b86..5b8bd5d 100644
---
a/pinot-core/src/test/java/org/apache/pinot/core/common/docidsets/BitmapDocIdSetTest.java
+++
b/pinot-core/src/test/java/org/apache/pinot/core/common/docidsets/BitmapDocIdSetTest.java
@@ -54,14 +54,12 @@ public class BitmapDocIdSetTest {
originalSet.add(docId);
mutableRoaringBitmap.add(docId);
}
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(bos);
- // could call "rr1.runOptimize()" and "rr2.runOptimize" if there
+ // could call "rr1.runOptimize()" and "rr2.runOptimize" if
// there were runs to compress
- mutableRoaringBitmap.serialize(dos);
- dos.close();
- ByteBuffer bb = ByteBuffer.wrap(bos.toByteArray());
- ImmutableRoaringBitmap immutableRoaringBitmap = new
ImmutableRoaringBitmap(bb);
+ final ByteBuffer buffer =
ByteBuffer.allocate(mutableRoaringBitmap.serializedSizeInBytes());
+ mutableRoaringBitmap.serialize(buffer);
+ buffer.flip();
+ ImmutableRoaringBitmap immutableRoaringBitmap = new
ImmutableRoaringBitmap(buffer);
list.add(immutableRoaringBitmap);
}
ImmutableRoaringBitmap[] bitmaps = new ImmutableRoaringBitmap[list.size()];
diff --git a/pom.xml b/pom.xml
index 7d4c1ab..52abd08 100644
--- a/pom.xml
+++ b/pom.xml
@@ -327,7 +327,7 @@
<dependency>
<groupId>org.roaringbitmap</groupId>
<artifactId>RoaringBitmap</artifactId>
- <version>0.5.10</version>
+ <version>0.8.0</version>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]