public static byte[] serialize(BloomFilter filter) {
        DataOutputBuffer out = new DataOutputBuffer();
        try {
            BloomFilter.serializer().serialize(filter, out);
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return out.getData();
    }
@Ignore
    @Test
    public void timeSerialize() throws IOException {
        for (int i = 0; i < 1000; i++) {
            BloomFilter f = new BloomFilter(1000000, 0.01);
            serialize(f);
        }
    }