flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [1/2] flink git commit: [FLINK-3928] [gelly] Potential overflow due to 32-bit int arithmetic
Date Fri, 20 May 2016 20:19:57 GMT
Repository: flink
Updated Branches:
  refs/heads/master 9a4fdd5fb -> 8ed368582


[FLINK-3928] [gelly] Potential overflow due to 32-bit int arithmetic

This closes #2006


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/72376699
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/72376699
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/72376699

Branch: refs/heads/master
Commit: 723766993ce659f7316c890fcce7d0633957e448
Parents: 9a4fdd5
Author: Greg Hogan <code@greghogan.com>
Authored: Wed May 18 14:40:33 2016 -0400
Committer: Greg Hogan <code@greghogan.com>
Committed: Fri May 20 12:47:48 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/graph/examples/Graph500.java  | 2 +-
 .../apache/flink/graph/examples/LocalClusteringCoefficient.java  | 2 +-
 .../java/org/apache/flink/graph/examples/TriangleListing.java    | 2 +-
 .../src/test/java/org/apache/flink/graph/asm/AsmTestBase.java    | 2 +-
 .../org/apache/flink/graph/generator/HypercubeGraphTest.java     | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/72376699/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/Graph500.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/Graph500.java
b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/Graph500.java
index b9d6fbd..0daadc1 100644
--- a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/Graph500.java
+++ b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/Graph500.java
@@ -63,7 +63,7 @@ public class Graph500 {
 
 		RandomGenerableFactory<JDKRandomGenerator> rnd = new JDKRandomGeneratorFactory();
 
-		long vertexCount = 1 << scale;
+		long vertexCount = 1L << scale;
 		long edgeCount = vertexCount * edgeFactor;
 
 		boolean simplify = parameters.getBoolean("simplify", DEFAULT_SIMPLIFY);

http://git-wip-us.apache.org/repos/asf/flink/blob/72376699/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/LocalClusteringCoefficient.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/LocalClusteringCoefficient.java
b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/LocalClusteringCoefficient.java
index 2465da8..ed27553 100644
--- a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/LocalClusteringCoefficient.java
+++ b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/LocalClusteringCoefficient.java
@@ -67,7 +67,7 @@ public class LocalClusteringCoefficient {
 
 		RandomGenerableFactory<JDKRandomGenerator> rnd = new JDKRandomGeneratorFactory();
 
-		long vertexCount = 1 << scale;
+		long vertexCount = 1L << scale;
 		long edgeCount = vertexCount * edgeFactor;
 
 		boolean clipAndFlip = parameters.getBoolean("clip_and_flip", DEFAULT_CLIP_AND_FLIP);

http://git-wip-us.apache.org/repos/asf/flink/blob/72376699/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/TriangleListing.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/TriangleListing.java
b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/TriangleListing.java
index f5f232d..3467f69 100644
--- a/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/TriangleListing.java
+++ b/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/examples/TriangleListing.java
@@ -66,7 +66,7 @@ public class TriangleListing {
 
 		RandomGenerableFactory<JDKRandomGenerator> rnd = new JDKRandomGeneratorFactory();
 
-		long vertexCount = 1 << scale;
+		long vertexCount = 1L << scale;
 		long edgeCount = vertexCount * edgeFactor;
 
 		boolean clipAndFlip = parameters.getBoolean("clip_and_flip", DEFAULT_CLIP_AND_FLIP);

http://git-wip-us.apache.org/repos/asf/flink/blob/72376699/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/asm/AsmTestBase.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/asm/AsmTestBase.java
b/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/asm/AsmTestBase.java
index 0d98ffc..0f843fa 100644
--- a/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/asm/AsmTestBase.java
+++ b/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/asm/AsmTestBase.java
@@ -89,7 +89,7 @@ public class AsmTestBase {
 			.generate();
 
 		// RMat graph
-		long rmatVertexCount = 1 << 10;
+		long rmatVertexCount = 1L << 10;
 		long rmatEdgeCount = 16 * rmatVertexCount;
 
 		directedRMatGraph = new RMatGraph<>(env, new JDKRandomGeneratorFactory(), rmatVertexCount,
rmatEdgeCount)

http://git-wip-us.apache.org/repos/asf/flink/blob/72376699/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/HypercubeGraphTest.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/HypercubeGraphTest.java
b/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/HypercubeGraphTest.java
index 77eed89..12024be 100644
--- a/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/HypercubeGraphTest.java
+++ b/flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/HypercubeGraphTest.java
@@ -54,8 +54,8 @@ extends AbstractGraphTest {
 		Graph<LongValue, NullValue, NullValue> graph = new HypercubeGraph(env, dimensions)
 			.generate();
 
-		assertEquals(1 << dimensions, graph.numberOfVertices());
-		assertEquals(dimensions * (1 << dimensions), graph.numberOfEdges());
+		assertEquals(1L << dimensions, graph.numberOfVertices());
+		assertEquals(dimensions * (1L << dimensions), graph.numberOfEdges());
 
 		long minInDegree = graph.inDegrees().min(1).collect().get(0).f1;
 		long minOutDegree = graph.outDegrees().min(1).collect().get(0).f1;


Mime
View raw message