Search in sources :

Example 1 with UnsignedShortValueToLongValueWithProperHashCode

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

the class GraphKeyTypeTransformTest method testFromShortValue.

@Test
public void testFromShortValue() throws Exception {
    TranslateFunction<ShortValue, LongValueWithProperHashCode> translator = new UnsignedShortValueToLongValueWithProperHashCode();
    Assert.assertEquals(new LongValueWithProperHashCode(0L), translator.translate(new ShortValue((short) 0), longValueWithProperHashCode));
    Assert.assertEquals(new LongValueWithProperHashCode(Short.MAX_VALUE + 1), translator.translate(new ShortValue(Short.MIN_VALUE), longValueWithProperHashCode));
    Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedShortValue.MAX_VERTEX_COUNT - 1), translator.translate(new ShortValue((short) -1), longValueWithProperHashCode));
}
Also used : UnsignedShortValueToLongValueWithProperHashCode(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedShortValueToLongValueWithProperHashCode) LongValueToUnsignedShortValue(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedShortValue) ShortValue(org.apache.flink.types.ShortValue) 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 LongValueToUnsignedShortValue (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedShortValue)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 ShortValue (org.apache.flink.types.ShortValue)1 Test (org.junit.Test)1