-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from bloxbean/bitmap
Bitmap implementation
- Loading branch information
Showing
12 changed files
with
1,183 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
core/src/main/java/com/bloxbean/rocks/types/collection/RocksBitmap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.bloxbean.rocks.types.collection; | ||
|
||
import com.bloxbean.rocks.types.config.RocksDBConfig; | ||
import org.roaringbitmap.RoaringBitmap; | ||
import org.rocksdb.WriteBatch; | ||
|
||
/** | ||
* Bitmap implementation using RocksDB | ||
* RocksBitmap is a wrapper class for RocksMultiBitmap with default column family | ||
*/ | ||
public class RocksBitmap extends RocksMultiBitmap { | ||
|
||
public RocksBitmap(RocksDBConfig rocksDBConfig, String name) { | ||
super(rocksDBConfig, name); | ||
} | ||
|
||
public RocksBitmap(RocksDBConfig rocksDBConfig, String name, int fragmentSize) { | ||
super(rocksDBConfig, name, fragmentSize); | ||
} | ||
|
||
public RocksBitmap(RocksDBConfig rocksDBConfig, String columnFamily, String name) { | ||
super(rocksDBConfig, columnFamily, name); | ||
} | ||
|
||
public RocksBitmap(RocksDBConfig rocksDBConfig, String columnFamily, String name, int fragmentSize) { | ||
super(rocksDBConfig, columnFamily, name, fragmentSize); | ||
} | ||
|
||
public void setBit(int index) { | ||
super.setBit(null, index); | ||
} | ||
|
||
public void setBitBatch(WriteBatch writeBatch, int... bitIndexes) { | ||
super.setBitBatch(null, writeBatch, bitIndexes); | ||
} | ||
|
||
public boolean getBit(int bitIndex) { | ||
return super.getBit(null, bitIndex); | ||
} | ||
|
||
public void clearBit(int bitIndex) { | ||
super.clearBit(null, bitIndex); | ||
} | ||
|
||
public void clearBitBatch(WriteBatch writeBatch, int... bitIndexes) { | ||
super.clearBitBatch(null, writeBatch, bitIndexes); | ||
} | ||
|
||
public long nextSetBit(int fromIndex) { | ||
return super.nextSetBit(null, fromIndex); | ||
} | ||
|
||
public long nextClearBit(int fromIndex) { | ||
return super.nextClearBit(null, fromIndex); | ||
} | ||
|
||
public long previousSetBit(int fromIndex) { | ||
return super.previousSetBit(null, fromIndex); | ||
} | ||
|
||
public long previousClearBit(int fromIndex) { | ||
return super.previousClearBit(null, fromIndex); | ||
} | ||
|
||
public RoaringBitmap getAllBits() { | ||
return super.getAllBits(null); | ||
} | ||
|
||
public RoaringBitmap getBits(int fromFragmentIndex, int toFragmentIndex) { | ||
return super.getBits(null, fromFragmentIndex, toFragmentIndex); | ||
} | ||
} |
Oops, something went wrong.