giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: updated refs/heads/trunk to 487ec36
Date Fri, 07 Jun 2013 17:45:44 GMT
Updated Branches:
  refs/heads/trunk 3d4f31343 -> 487ec36fb


GIRAPH-682: LongNullHashSetEdges performance issue


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

Branch: refs/heads/trunk
Commit: 487ec36fb2e124646a238c9aa294ad63510e6ab3
Parents: 3d4f313
Author: Maja Kabiljo <majakabiljo@maja-mbp.thefacebook.com>
Authored: Fri Jun 7 10:20:25 2013 -0700
Committer: Maja Kabiljo <majakabiljo@maja-mbp.thefacebook.com>
Committed: Fri Jun 7 10:20:25 2013 -0700

----------------------------------------------------------------------
 .../apache/giraph/edge/LongNullHashSetEdges.java   |   20 ++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/487ec36f/giraph-core/src/main/java/org/apache/giraph/edge/LongNullHashSetEdges.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/edge/LongNullHashSetEdges.java b/giraph-core/src/main/java/org/apache/giraph/edge/LongNullHashSetEdges.java
index 139fc7a..a21de91 100644
--- a/giraph-core/src/main/java/org/apache/giraph/edge/LongNullHashSetEdges.java
+++ b/giraph-core/src/main/java/org/apache/giraph/edge/LongNullHashSetEdges.java
@@ -40,7 +40,8 @@ import java.util.Iterator;
  */
 public class LongNullHashSetEdges
     implements ReuseObjectsOutEdges<LongWritable, NullWritable>,
-    MutableOutEdges<LongWritable, NullWritable> {
+    MutableOutEdges<LongWritable, NullWritable>,
+    StrictRandomAccessOutEdges<LongWritable, NullWritable> {
   /** Hash set of target vertex ids. */
   private LongOpenHashSet neighbors;
 
@@ -125,4 +126,21 @@ public class LongNullHashSetEdges
       neighbors.add(in.readLong());
     }
   }
+
+  @Override
+  public NullWritable getEdgeValue(LongWritable targetVertexId) {
+    if (neighbors.contains(targetVertexId.get())) {
+      return NullWritable.get();
+    } else {
+      return null;
+    }
+  }
+
+  @Override
+  public void setEdgeValue(LongWritable targetVertexId,
+    NullWritable edgeValue) {
+    // No operation.
+    // Only set value for an existing edge.
+    // If the edge exist, the Null value is already there.
+  }
 }


Mime
View raw message