Search in sources :

Example 1 with UnsignedFloatToLongValueWithProperHashCode

use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatToLongValueWithProperHashCode in project flink by apache.

the class GraphKeyTypeTransformTest method testFromFloat.

@Test
public void testFromFloat() throws Exception {
    TranslateFunction<Float, LongValueWithProperHashCode> translator = new UnsignedFloatToLongValueWithProperHashCode();
    Assert.assertEquals(new LongValueWithProperHashCode(0L), translator.translate(Float.intBitsToFloat(0), longValueWithProperHashCode));
    Assert.assertEquals(new LongValueWithProperHashCode((long) Integer.MAX_VALUE + 1), translator.translate(Float.intBitsToFloat(Integer.MIN_VALUE), longValueWithProperHashCode));
    Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedFloat.MAX_VERTEX_COUNT - 1), translator.translate(Float.intBitsToFloat(-1), longValueWithProperHashCode));
}
Also used : LongValueToUnsignedFloat(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedFloat) UnsignedFloatToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatToLongValueWithProperHashCode) UnsignedShortValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedShortValueToLongValueWithProperHashCode) DoubleToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.DoubleToLongValueWithProperHashCode) UnsignedByteValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteValueToLongValueWithProperHashCode) UnsignedIntToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedIntToLongValueWithProperHashCode) DoubleValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.DoubleValueToLongValueWithProperHashCode) StringToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.StringToLongValueWithProperHashCode) UnsignedFloatToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatToLongValueWithProperHashCode) LongValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToLongValueWithProperHashCode) StringValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.StringValueToLongValueWithProperHashCode) UnsignedByteToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteToLongValueWithProperHashCode) UnsignedFloatValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatValueToLongValueWithProperHashCode) UnsignedShortToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedShortToLongValueWithProperHashCode) Test(org.junit.Test)

Aggregations

DoubleToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.DoubleToLongValueWithProperHashCode)1 DoubleValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.DoubleValueToLongValueWithProperHashCode)1 LongValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToLongValueWithProperHashCode)1 LongValueToUnsignedFloat (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedFloat)1 StringToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.StringToLongValueWithProperHashCode)1 StringValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.StringValueToLongValueWithProperHashCode)1 UnsignedByteToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteToLongValueWithProperHashCode)1 UnsignedByteValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteValueToLongValueWithProperHashCode)1 UnsignedFloatToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatToLongValueWithProperHashCode)1 UnsignedFloatValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatValueToLongValueWithProperHashCode)1 UnsignedIntToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedIntToLongValueWithProperHashCode)1 UnsignedShortToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedShortToLongValueWithProperHashCode)1 UnsignedShortValueToLongValueWithProperHashCode (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedShortValueToLongValueWithProperHashCode)1 Test (org.junit.Test)1