Search in sources :

Example 1 with UnsignedByteValueToLongValueWithProperHashCode

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

the class GraphKeyTypeTransformTest method testFromByteValue.

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