Package com.metamx.collections.bitmap

Examples of com.metamx.collections.bitmap.ImmutableBitmap


          if (onlyOneValue) {
            log.info("Dimension[%s] is single value, converting...", dimension);
            final boolean bumpedDictionary;
            if (nullsSet != null) {
              log.info("Dimension[%s] has null rows.", dimension);
              final ImmutableBitmap theNullSet = bitmapFactory.makeImmutableBitmap(nullsSet);

              if (dictionary.get(0) != null) {
                log.info("Dimension[%s] has no null value in the dictionary, expanding...", dimension);
                bumpedDictionary = true;
                final List<String> nullList = Lists.newArrayList();
View Full Code Here


  @BenchmarkOptions(warmupRounds = 10, benchmarkRounds = 1000)
  @Test
  public void testToImmutableByteArray()
  {
    ImmutableBitmap immutableBitmap = factory.makeImmutableBitmap(baseMutableBitmap);
    Assert.assertArrayEquals(baseBytes, immutableBitmap.toBytes());
  }
View Full Code Here

  @BenchmarkOptions(warmupRounds = 10, benchmarkRounds = 1000)
  @Test
  public void testFromImmutableByteArray()
  {
    ImmutableBitmap immutableBitmap = factory.mapImmutableBitmap(baseByteBuffer);
    Assert.assertEquals(numBits, immutableBitmap.size());
  }
View Full Code Here

    }

    GenericIndexed<ImmutableBitmap> bitmaps;

    if (nullSet != null) {
      final ImmutableBitmap theNullSet = bitmapFactory.makeImmutableBitmap(nullSet);
      if (bumpDictionary) {
        bitmaps = GenericIndexed.fromIterable(
            Iterables.concat(
                Arrays.asList(theNullSet),
                Iterables.transform(
                    mutableBitmaps,
                    new Function<MutableBitmap, ImmutableBitmap>()
                    {
                      @Override
                      public ImmutableBitmap apply(MutableBitmap input)
                      {
                        return bitmapFactory.makeImmutableBitmap(input);
                      }
                    }
                )
            ),
            bitmapSerdeFactory.getObjectStrategy()
        );
      } else {
        Iterable<ImmutableBitmap> immutableBitmaps = Iterables.transform(
            mutableBitmaps,
            new Function<MutableBitmap, ImmutableBitmap>()
            {
              @Override
              public ImmutableBitmap apply(MutableBitmap input)
              {
                return bitmapFactory.makeImmutableBitmap(input);
              }
            }
        );

        bitmaps = GenericIndexed.fromIterable(
            Iterables.concat(
                Arrays.asList(
                    theNullSet.union(Iterables.getFirst(immutableBitmaps, null))
                ),
                Iterables.skip(immutableBitmaps, 1)
            ),
            bitmapSerdeFactory.getObjectStrategy()
        );
View Full Code Here

  public ImmutableBitmap getBitmapIndex(final BitmapIndexSelector selector)
  {
    final Context cx = Context.enter();
    try {
      final Indexed<String> dimValues = selector.getDimensionValues(dimension);
      ImmutableBitmap bitmap;
      if (dimValues == null) {
        bitmap = selector.getBitmapFactory().makeEmptyImmutableBitmap();
      } else {
        bitmap = selector.getBitmapFactory().union(
            FunctionalIterable.create(dimValues)
View Full Code Here

      {
        if (idx < 0) {
          return bitmapFactory.makeEmptyImmutableBitmap();
        }

        final ImmutableBitmap bitmap = bitmaps.get(idx);
        return bitmap == null ? bitmapFactory.makeEmptyImmutableBitmap() : bitmap;
      }
    };
  }
View Full Code Here

        dimsToSearch = dimensions;
      }

      BitmapFactory bitmapFactory = index.getBitmapFactoryForDimensions();

      final ImmutableBitmap baseFilter;
      if (filter == null) {
        baseFilter = bitmapFactory.complement(bitmapFactory.makeEmptyImmutableBitmap(), index.getNumRows());
      } else {
        ColumnSelectorBitmapIndexSelector selector = new ColumnSelectorBitmapIndexSelector(bitmapFactory, index);
        baseFilter = filter.getBitmapIndex(selector);
View Full Code Here

TOP

Related Classes of com.metamx.collections.bitmap.ImmutableBitmap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.