Java Code Examples for org.roaringbitmap.buffer.ImmutableRoaringBitmap#getIntIterator()

The following examples show how to use org.roaringbitmap.buffer.ImmutableRoaringBitmap#getIntIterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MVScanDocIdIterator.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
@Override
public MutableRoaringBitmap applyAnd(ImmutableRoaringBitmap docIds) {
  MutableRoaringBitmap result = new MutableRoaringBitmap();
  IntIterator docIdIterator = docIds.getIntIterator();
  int nextDocId;
  while (docIdIterator.hasNext() && (nextDocId = docIdIterator.next()) < _numDocs) {
    int length = _valueSet.getIntValues(nextDocId, _dictIdBuffer);
    _numEntriesScanned += length;
    if (_predicateEvaluator.applyMV(_dictIdBuffer, length)) {
      result.add(nextDocId);
    }
  }
  return result;
}
 
Example 2
Source File: SVScanDocIdIterator.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
@Override
public MutableRoaringBitmap applyAnd(ImmutableRoaringBitmap docIds) {
  MutableRoaringBitmap result = new MutableRoaringBitmap();
  IntIterator docIdIterator = docIds.getIntIterator();
  int nextDocId;
  while (docIdIterator.hasNext() && (nextDocId = docIdIterator.next()) < _numDocs) {
    _numEntriesScanned++;
    if (_valueMatcher.doesValueMatch(nextDocId)) {
      result.add(nextDocId);
    }
  }
  return result;
}
 
Example 3
Source File: BitmapInvertedIndexCreatorTest.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
private void validate(File invertedIndex, Set<Integer>[] postingLists)
    throws IOException {
  try (BitmapInvertedIndexReader reader = new BitmapInvertedIndexReader(
      PinotDataBuffer.mapReadOnlyBigEndianFile(invertedIndex), CARDINALITY)) {
    for (int dictId = 0; dictId < CARDINALITY; dictId++) {
      ImmutableRoaringBitmap bitmap = reader.getDocIds(dictId);
      Set<Integer> expected = postingLists[dictId];
      Assert.assertEquals(bitmap.getCardinality(), expected.size());
      IntIterator intIterator = bitmap.getIntIterator();
      while (intIterator.hasNext()) {
        Assert.assertTrue(expected.contains(intIterator.next()));
      }
    }
  }
}
 
Example 4
Source File: ExpressionScanDocIdIterator.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
BitmapDocIdSetOperator(ImmutableRoaringBitmap bitmap) {
  _intIterator = bitmap.getIntIterator();
}
 
Example 5
Source File: RangelessBitmapDocIdIterator.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public RangelessBitmapDocIdIterator(ImmutableRoaringBitmap docIds) {
  _docIds = docIds;
  _docIdIterator = docIds.getIntIterator();
}
 
Example 6
Source File: BitmapDocIdIterator.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public BitmapDocIdIterator(ImmutableRoaringBitmap docIds, int numDocs) {
  _docIds = docIds;
  _docIdIterator = docIds.getIntIterator();
  _numDocs = numDocs;
}