Example usage for org.apache.hadoop.util.bloom Filter not

List of usage examples for org.apache.hadoop.util.bloom Filter not

Introduction

In this page you can find the example usage for org.apache.hadoop.util.bloom Filter not.

Prototype

public abstract void not();

Source Link

Document

Performs a logical NOT on this filter.

Usage

From source file:brickhouse.udf.bloom.BloomNotUDF.java

License:Apache License

public String evaluate(String bloomStr) throws IOException {
    Filter bloom = BloomFactory.GetBloomFilter(bloomStr);

    /// Perform a logical not 
    bloom.not();

    return BloomFactory.WriteBloomToString(bloom);
}

From source file:hivemall.sketch.bloom.BloomNotUDF.java

License:Apache License

@Nullable
public Text evaluate(@Nullable Text bloomStr) throws HiveException {
    if (bloomStr == null) {
        return null;
    }// ww  w  . j a  v  a  2  s  .c  om

    final Filter bloom;
    try {
        bloom = BloomFilterUtils.deserialize(bloomStr, new DynamicBloomFilter());
    } catch (IOException e) {
        throw new HiveException(e);
    }

    bloom.not();

    try {
        return BloomFilterUtils.serialize(bloom, new Text());
    } catch (IOException e) {
        throw new HiveException(e);
    }
}