Search in sources :

Example 1 with LongValueToUnsignedByteValue

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

the class GraphKeyTypeTransformTest method testToByteValue.

// ByteValue
@Test
public void testToByteValue() throws Exception {
    TranslateFunction<LongValue, ByteValue> translator = new LongValueToUnsignedByteValue();
    Assert.assertEquals(new ByteValue((byte) 0), translator.translate(new LongValue(0L), byteValue));
    Assert.assertEquals(new ByteValue(Byte.MIN_VALUE), translator.translate(new LongValue(Byte.MAX_VALUE + 1), byteValue));
    Assert.assertEquals(new ByteValue((byte) -1), translator.translate(new LongValue(LongValueToUnsignedByteValue.MAX_VERTEX_COUNT - 1), byteValue));
}
Also used : ByteValue(org.apache.flink.types.ByteValue) LongValueToUnsignedByteValue(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedByteValue) LongValue(org.apache.flink.types.LongValue) LongValueToUnsignedByteValue(org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedByteValue) Test(org.junit.Test)

Aggregations

LongValueToUnsignedByteValue (org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToUnsignedByteValue)1 ByteValue (org.apache.flink.types.ByteValue)1 LongValue (org.apache.flink.types.LongValue)1 Test (org.junit.Test)1