use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedFloatValue in project flink by apache.
the class GraphKeyTypeTransformTest method testToFloatValue.
// FloatValue
@Test
public void testToFloatValue() throws Exception {
TranslateFunction<LongValue, FloatValue> translator = new LongValueToUnsignedFloatValue();
Assert.assertEquals(new FloatValue(Float.intBitsToFloat(0)), translator.translate(new LongValue(0L), floatValue));
Assert.assertEquals(new FloatValue(Float.intBitsToFloat(Integer.MIN_VALUE)), translator.translate(new LongValue((long) Integer.MAX_VALUE + 1), floatValue));
Assert.assertEquals(new FloatValue(Float.intBitsToFloat(-1)), translator.translate(new LongValue(LongValueToUnsignedFloatValue.MAX_VERTEX_COUNT - 1), floatValue));
}
Aggregations