Example usage for org.apache.hadoop.util.bloom BloomFilter readFields

List of usage examples for org.apache.hadoop.util.bloom BloomFilter readFields

Introduction

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

Prototype

@Override
    public void readFields(DataInput in) throws IOException 

Source Link

Usage

From source file:com.cloudera.util.bloom.BloomSet.java

License:Apache License

/**
 * Takes an array of bytes and deserializes it into the current BloomSet.
 *///from ww  w.j av a2s  .c o m
protected BloomFilter deserialize(byte[] serialized) {
    try {
        Preconditions.checkArgument(serialized != null);
        DataInputStream in = new DataInputStream(new ByteArrayInputStream(serialized));
        BloomFilter bloom = new BloomFilter(); // empty constructor
        bloom.readFields(in);
        return bloom;
    } catch (IOException e) {
        throw new IllegalArgumentException(e.getMessage());
    }
}

From source file:org.apache.pig.builtin.BuildBloomBase.java

License:Apache License

protected BloomFilter bloomIn(DataByteArray b) throws IOException {
    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b.get()));
    BloomFilter f = new BloomFilter();
    f.readFields(dis);
    return f;//from  ww w.j a  va 2  s . c  o m
}