diff --git a/base-third-project/base-third-step1/pom.xml b/base-third-project/base-third-step1/pom.xml
index ce0a9e507..cc9979a75 100644
--- a/base-third-project/base-third-step1/pom.xml
+++ b/base-third-project/base-third-step1/pom.xml
@@ -37,6 +37,7 @@
兼容新引擎插件中用到的这个类,后续会删除
+ */
+@Deprecated
+public class RoaringBitmap {
+
+ private byte[] value;
+ private int length;
+ private int cap;
+
+ public RoaringBitmap() {
+ this(8192);
+ }
+
+ public RoaringBitmap(int cap) {
+ this.cap = cap;
+ this.value = new byte[(cap + 7) / 8];
+ }
+
+ public void add(int n) {
+ checkIndex(n);
+ ensureCap(n);
+ int idx0 = n / 8;
+ int idx1 = n % 8;
+ if ((value[idx0] & (1 << idx1)) == 0) {
+ length++;
+ value[idx0] |= (1 << idx1);
+ }
+ }
+
+ public void remove(int n) {
+ checkIndex(n);
+ if (n >= value.length * 8) {
+ return;
+ }
+ int idx0 = n / 8;
+ int idx1 = n % 8;
+ if ((value[idx0] & (1 << idx1)) != 0) {
+ length--;
+ value[idx0] &= ~(1 << idx1);
+ }
+ }
+
+ public boolean contains(int n) {
+ checkIndex(n);
+ if (n >= value.length * 8) {
+ return false;
+ }
+ int idx0 = n / 8;
+ int idx1 = n % 8;
+ return (value[idx0] & (1 << idx1)) != 0;
+ }
+
+ public void flip(long rangeStart, long rangeEnd) {
+ int sIdx0 = (int) ((rangeStart + 7) / 8);
+ int sIdx1 = (int) (rangeStart % 8);
+ int eIdx0 = (int) (rangeEnd / 8);
+ int eIdx1 = (int) (rangeEnd % 8);
+ int lenDiff = 0;
+ if (sIdx1 > 0) {
+ byte b = value[sIdx0 - 1];
+ byte b2 = (byte) (~(b & 0xff) >> sIdx1 << sIdx1 + ((b & 0xff) << (32 - sIdx1) >> (32 - sIdx1)));
+ value[sIdx0 - 1] = b2;
+ lenDiff += countInByte(b2) - countInByte(b);
+ }
+ for (int i = sIdx0; i < eIdx0; i++) {
+ value[i] = (byte) ~(value[i]);
+ lenDiff += countInByte(value[i]) * 2 - 8;
+ }
+ if (eIdx1 > 0) {
+ byte b = value[eIdx0];
+ byte b2 = (byte) (((b & 0xff) >> eIdx1 << eIdx1) + ~(b & 0xff) << (32 - eIdx1) >> (32 - eIdx1));
+ value[eIdx0] = b2;
+ lenDiff += countInByte(b2) - countInByte(b);
+ }
+ length += lenDiff;
+ }
+
+ public int getCardinality() {
+ return length;
+ }
+
+ @Override
+ public RoaringBitmap clone() {
+ RoaringBitmap bm = new RoaringBitmap(cap);
+ bm.length = length;
+ bm.value = new byte[value.length];
+ System.arraycopy(value, 0, bm.value, 0, value.length);
+ return bm;
+ }
+
+ public static RoaringBitmap and(RoaringBitmap bm1, RoaringBitmap bm2) {
+ int len = Integer.min(bm1.value.length, bm2.value.length);
+ RoaringBitmap bm = new RoaringBitmap(Integer.max(bm1.cap, bm2.cap));
+ bm.value = new byte[len];
+ for (int i = 0; i < len; i++) {
+ byte b = (byte) (bm1.value[i] & bm2.value[i]);
+ if (b == 0) {
+ continue;
+ }
+ bm.value[i] = b;
+ bm.length += countInByte(b);
+ }
+ return bm;
+ }
+
+ public static int andCardinality(RoaringBitmap bm1, RoaringBitmap bm2) {
+ int len = Integer.min(bm1.value.length, bm2.value.length);
+ int count = 0;
+ for (int i = 0; i < len; i++) {
+ byte b = (byte) (bm1.value[i] & bm2.value[i]);
+ if (b == 0) {
+ continue;
+ }
+ count += countInByte(b);
+ }
+ return count;
+ }
+
+ public Iterator