List of usage examples for org.apache.hadoop.util.bloom BloomFilter write
@Override
public void write(DataOutput out) throws IOException
From source file:gaffer.accumulostore.utils.IteratorSettingBuilder.java
License:Apache License
public IteratorSettingBuilder bloomFilter(final BloomFilter filter) throws IteratorSettingException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); try {//from ww w . j a va 2 s.co m filter.write(new DataOutputStream(baos)); } catch (final IOException e) { throw new IteratorSettingException("Failed to write bloom filter", e); } try { setting.addOption(AccumuloStoreConstants.BLOOM_FILTER, new String(baos.toByteArray(), AccumuloStoreConstants.BLOOM_FILTER_CHARSET)); } catch (final UnsupportedEncodingException e) { throw new IteratorSettingException("Failed to encode the bloom filter to a string", e); } return this; }