org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToDoubleValue Java Examples

The following examples show how to use org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.LongValueToDoubleValue. 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   Author: ljygz   File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testToDoubleValue() throws Exception {
	TranslateFunction<LongValue, DoubleValue> translator = new LongValueToDoubleValue();

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(0L)),
		translator.translate(new LongValue(0L), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MIN_VALUE)),
		translator.translate(new LongValue(Long.MIN_VALUE), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MAX_VALUE)),
		translator.translate(new LongValue(Long.MAX_VALUE), doubleValue));
}
 
Example #2
Source Project: flink   Author: flink-tpc-ds   File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testToDoubleValue() throws Exception {
	TranslateFunction<LongValue, DoubleValue> translator = new LongValueToDoubleValue();

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(0L)),
		translator.translate(new LongValue(0L), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MIN_VALUE)),
		translator.translate(new LongValue(Long.MIN_VALUE), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MAX_VALUE)),
		translator.translate(new LongValue(Long.MAX_VALUE), doubleValue));
}
 
Example #3
Source Project: flink   Author: apache   File: GraphKeyTypeTransformTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testToDoubleValue() throws Exception {
	TranslateFunction<LongValue, DoubleValue> translator = new LongValueToDoubleValue();

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(0L)),
		translator.translate(new LongValue(0L), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MIN_VALUE)),
		translator.translate(new LongValue(Long.MIN_VALUE), doubleValue));

	Assert.assertEquals(new DoubleValue(Double.longBitsToDouble(Long.MAX_VALUE)),
		translator.translate(new LongValue(Long.MAX_VALUE), doubleValue));
}