use of com.yahoo.sketches.hll.Union in project Gaffer by gchq.
the class HllUnionSerialiserTest method testSerialiser.
private void testSerialiser(final Union sketch) {
final double cardinality = sketch.getEstimate();
final byte[] sketchSerialised;
try {
sketchSerialised = SERIALISER.serialise(sketch);
} catch (final SerialisationException exception) {
fail("A SerialisationException occurred");
return;
}
final Union sketchDeserialised;
try {
sketchDeserialised = SERIALISER.deserialise(sketchSerialised);
} catch (final SerialisationException exception) {
fail("A SerialisationException occurred");
return;
}
assertEquals(cardinality, sketchDeserialised.getEstimate(), DELTA);
}
Aggregations