Package javaewah

Examples of javaewah.EWAHCompressedBitmap


    }

    @Override
    public void reset(AggregationBuffer agg) throws HiveException {

        ((BitmapAgg) agg).bitmap = new EWAHCompressedBitmap();
    }
View Full Code Here


    public void merge(AggregationBuffer agg, Object partial)
        throws HiveException {
      BitmapAgg myagg = (BitmapAgg) agg;
      ArrayList<LongWritable> partialResult = (ArrayList<LongWritable>) internalMergeOI.getList(partial);
      BitmapObjectInput bitmapObjIn = new BitmapObjectInput(partialResult);
      EWAHCompressedBitmap partialBitmap = new EWAHCompressedBitmap();
      try {
        partialBitmap.readExternal(bitmapObjIn);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
      myagg.bitmap = myagg.bitmap.or(partialBitmap);
    }
View Full Code Here

          (PrimitiveObjectInspector) lloi.getListElementObjectInspector());
      bitmapArray.add(new LongWritable(l));
    }

    BitmapObjectInput bitmapObjIn = new BitmapObjectInput(bitmapArray);
    EWAHCompressedBitmap bitmap = new EWAHCompressedBitmap();
    try {
      bitmap.readExternal(bitmapObjIn);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

     // Add return true only if bitmap is all zeros.
     return new BooleanWritable(!bitmap.iterator().hasNext());
  }
View Full Code Here

  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    assert (arguments.length == 2);
    Object b1 = arguments[0].get();
    Object b2 = arguments[1].get();

    EWAHCompressedBitmap bitmap1 = wordArrayToBitmap(b1);
    EWAHCompressedBitmap bitmap2 = wordArrayToBitmap(b2);

    EWAHCompressedBitmap bitmapAnd = bitmapBop(bitmap1, bitmap2);

    BitmapObjectOutput bitmapObjOut = new BitmapObjectOutput();
    try {
      bitmapAnd.writeExternal(bitmapObjOut);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    ret.clear();
    List<LongWritable> retList = bitmapToWordArray(bitmapAnd);
View Full Code Here

          (PrimitiveObjectInspector) lloi.getListElementObjectInspector());
      bitmapArray.add(new LongWritable(l));
    }

    BitmapObjectInput bitmapObjIn = new BitmapObjectInput(bitmapArray);
    EWAHCompressedBitmap bitmap = new EWAHCompressedBitmap();
    try {
      bitmap.readExternal(bitmapObjIn);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bitmap;
  }
View Full Code Here

          (PrimitiveObjectInspector) lloi.getListElementObjectInspector());
      bitmapArray.add(new LongWritable(l));
    }

    BitmapObjectInput bitmapObjIn = new BitmapObjectInput(bitmapArray);
    EWAHCompressedBitmap bitmap = new EWAHCompressedBitmap();
    try {
      bitmap.readExternal(bitmapObjIn);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

     // Add return true only if bitmap is all zeros.
     return new BooleanWritable(!bitmap.iterator().hasNext());
  }
View Full Code Here

    }

    @Override
    public void reset(AggregationBuffer agg) throws HiveException {

        ((BitmapAgg) agg).bitmap = new EWAHCompressedBitmap();
    }
View Full Code Here

    public void merge(AggregationBuffer agg, Object partial)
        throws HiveException {
      BitmapAgg myagg = (BitmapAgg) agg;
      ArrayList<LongWritable> partialResult = (ArrayList<LongWritable>) internalMergeOI.getList(partial);
      BitmapObjectInput bitmapObjIn = new BitmapObjectInput(partialResult);
      EWAHCompressedBitmap partialBitmap = new EWAHCompressedBitmap();
      try {
        partialBitmap.readExternal(bitmapObjIn);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
      myagg.bitmap = myagg.bitmap.or(partialBitmap);
    }
View Full Code Here

  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    assert (arguments.length == 2);
    Object b1 = arguments[0].get();
    Object b2 = arguments[1].get();

    EWAHCompressedBitmap bitmap1 = wordArrayToBitmap(b1);
    EWAHCompressedBitmap bitmap2 = wordArrayToBitmap(b2);

    EWAHCompressedBitmap bitmapAnd = bitmapBop(bitmap1, bitmap2);

    BitmapObjectOutput bitmapObjOut = new BitmapObjectOutput();
    try {
      bitmapAnd.writeExternal(bitmapObjOut);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    ret.clear();
    List<LongWritable> retList = bitmapToWordArray(bitmapAnd);
View Full Code Here

          (PrimitiveObjectInspector) lloi.getListElementObjectInspector());
      bitmapArray.add(new LongWritable(l));
    }

    BitmapObjectInput bitmapObjIn = new BitmapObjectInput(bitmapArray);
    EWAHCompressedBitmap bitmap = new EWAHCompressedBitmap();
    try {
      bitmap.readExternal(bitmapObjIn);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bitmap;
  }
View Full Code Here

TOP

Related Classes of javaewah.EWAHCompressedBitmap

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.