Java Code Examples for org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteToLongValueWithProperHashCode

The following examples show how to use org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedByteToLongValueWithProperHashCode. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Flink-CEPplus   Source File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testFromByte() throws Exception {
	TranslateFunction<Byte, LongValueWithProperHashCode> translator = new UnsignedByteToLongValueWithProperHashCode();

	Assert.assertEquals(new LongValueWithProperHashCode(0L),
		translator.translate((byte) 0, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(Byte.MAX_VALUE + 1),
		translator.translate(Byte.MIN_VALUE, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedByte.MAX_VERTEX_COUNT - 1),
		translator.translate((byte) -1, longValueWithProperHashCode));
}
 
Example 2
Source Project: flink   Source File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testFromByte() throws Exception {
	TranslateFunction<Byte, LongValueWithProperHashCode> translator = new UnsignedByteToLongValueWithProperHashCode();

	Assert.assertEquals(new LongValueWithProperHashCode(0L),
		translator.translate((byte) 0, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(Byte.MAX_VALUE + 1),
		translator.translate(Byte.MIN_VALUE, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedByte.MAX_VERTEX_COUNT - 1),
		translator.translate((byte) -1, longValueWithProperHashCode));
}
 
Example 3
Source Project: flink   Source File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testFromByte() throws Exception {
	TranslateFunction<Byte, LongValueWithProperHashCode> translator = new UnsignedByteToLongValueWithProperHashCode();

	Assert.assertEquals(new LongValueWithProperHashCode(0L),
		translator.translate((byte) 0, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(Byte.MAX_VALUE + 1),
		translator.translate(Byte.MIN_VALUE, longValueWithProperHashCode));

	Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedByte.MAX_VERTEX_COUNT - 1),
		translator.translate((byte) -1, longValueWithProperHashCode));
}