You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by rv...@apache.org on 2014/10/26 02:21:47 UTC

[04/47] git commit: updated refs/heads/release-1.1 to 4c139ee

GIRAPH-922: SimpleEdgeStore has a bug causing NPE (pavanka)


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

Branch: refs/heads/release-1.1
Commit: 64428a9d0f8bca0edb1ccf34d281e89747b295f7
Parents: 58576c8
Author: Pavan Kumar <pa...@fb.com>
Authored: Wed Jun 18 16:14:40 2014 -0700
Committer: Pavan Kumar <pa...@fb.com>
Committed: Wed Jun 18 16:14:40 2014 -0700

----------------------------------------------------------------------
 CHANGELOG                                               |  2 ++
 .../java/org/apache/giraph/edge/AbstractEdgeStore.java  | 12 +++++-------
 .../java/org/apache/giraph/edge/SimpleEdgeStore.java    |  7 +++----
 .../org/apache/giraph/edge/primitives/IntEdgeStore.java |  7 +++----
 .../apache/giraph/edge/primitives/LongEdgeStore.java    |  7 +++----
 5 files changed, 16 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/64428a9d/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 659edfd..d315a9f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 Giraph Change Log
 
 Release 1.1.0 - unreleased
+  GIRAPH-922: SimpleEdgeStore has a bug causing NPE (pavanka)
+
   GIRAPH-915: With BigDataIO some messages can get ignored (majakabiljo via pavanka)
 
   GIRAPH-918: GIRAPH-908 has a small bug reg counting entries (pavanka)

http://git-wip-us.apache.org/repos/asf/giraph/blob/64428a9d/giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java b/giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java
index ee53718..b40ac00 100644
--- a/giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java
+++ b/giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java
@@ -121,14 +121,12 @@ public abstract class AbstractEdgeStore<I extends WritableComparable,
   protected abstract Map<K, OutEdges<I, E>> getPartitionEdges(int partitionId);
 
   /**
-   * Remove and return the OutEdges for a given partition
+   * Return the OutEdges for a given partition
    *
    * @param entry for vertexId key
-   * @param partitionEdges map of out-edges for vertices in a partition
    * @return out edges
    */
-  protected abstract OutEdges<I, E> removePartitionEdges(Et entry,
-    Map<K, OutEdges<I, E>> partitionEdges);
+  protected abstract OutEdges<I, E> getPartitionEdges(Et entry);
 
   /**
    * Get iterator for partition edges
@@ -223,10 +221,10 @@ public abstract class AbstractEdgeStore<I extends WritableComparable,
               // process all vertices in given partition
               while (iterator.hasNext()) {
                 Et entry = iterator.next();
-                I vertexId = getVertexId(entry,
-                    representativeVertexId);
+                I vertexId = getVertexId(entry, representativeVertexId);
                 OutEdges<I, E> outEdges = convertInputToComputeEdges(
-                    removePartitionEdges(entry, partitionEdges));
+                  getPartitionEdges(entry));
+                iterator.remove();
                 Vertex<I, V, E> vertex = partition.getVertex(vertexId);
                 // If the source vertex doesn't exist, create it. Otherwise,
                 // just set the edges.

http://git-wip-us.apache.org/repos/asf/giraph/blob/64428a9d/giraph-core/src/main/java/org/apache/giraph/edge/SimpleEdgeStore.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/edge/SimpleEdgeStore.java b/giraph-core/src/main/java/org/apache/giraph/edge/SimpleEdgeStore.java
index a6a3356..3eb97d6 100644
--- a/giraph-core/src/main/java/org/apache/giraph/edge/SimpleEdgeStore.java
+++ b/giraph-core/src/main/java/org/apache/giraph/edge/SimpleEdgeStore.java
@@ -87,10 +87,9 @@ public class SimpleEdgeStore<I extends WritableComparable,
   }
 
   @Override
-  protected OutEdges<I, E> removePartitionEdges(
-      Map.Entry<I, OutEdges<I, E>> entry,
-      Map<I, OutEdges<I, E>> partitionEdges) {
-    return partitionEdges.put(entry.getKey(), null);
+  protected OutEdges<I, E> getPartitionEdges(
+    Map.Entry<I, OutEdges<I, E>> entry) {
+    return entry.getValue();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/giraph/blob/64428a9d/giraph-core/src/main/java/org/apache/giraph/edge/primitives/IntEdgeStore.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/edge/primitives/IntEdgeStore.java b/giraph-core/src/main/java/org/apache/giraph/edge/primitives/IntEdgeStore.java
index 826c685..b138f49 100644
--- a/giraph-core/src/main/java/org/apache/giraph/edge/primitives/IntEdgeStore.java
+++ b/giraph-core/src/main/java/org/apache/giraph/edge/primitives/IntEdgeStore.java
@@ -75,10 +75,9 @@ public class IntEdgeStore<V extends Writable, E extends Writable>
   }
 
   @Override
-  protected OutEdges<IntWritable, E> removePartitionEdges(
-    Int2ObjectMap.Entry<OutEdges<IntWritable, E>> entry,
-    Map<Integer, OutEdges<IntWritable, E>> partitionEdges) {
-    return partitionEdges.put(entry.getIntKey(), null);
+  protected OutEdges<IntWritable, E> getPartitionEdges(
+    Int2ObjectMap.Entry<OutEdges<IntWritable, E>> entry) {
+    return entry.getValue();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/giraph/blob/64428a9d/giraph-core/src/main/java/org/apache/giraph/edge/primitives/LongEdgeStore.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/edge/primitives/LongEdgeStore.java b/giraph-core/src/main/java/org/apache/giraph/edge/primitives/LongEdgeStore.java
index 486410f..61f908a 100644
--- a/giraph-core/src/main/java/org/apache/giraph/edge/primitives/LongEdgeStore.java
+++ b/giraph-core/src/main/java/org/apache/giraph/edge/primitives/LongEdgeStore.java
@@ -76,10 +76,9 @@ public class LongEdgeStore<V extends Writable, E extends Writable>
 
 
   @Override
-  protected OutEdges<LongWritable, E> removePartitionEdges(
-      Long2ObjectMap.Entry<OutEdges<LongWritable, E>> entry,
-      Map<Long, OutEdges<LongWritable, E>> partitionEdges) {
-    return partitionEdges.put(entry.getLongKey(), null);
+  protected OutEdges<LongWritable, E> getPartitionEdges(
+    Long2ObjectMap.Entry<OutEdges<LongWritable, E>> entry) {
+    return entry.getValue();
   }
 
   @Override