You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by ac...@apache.org on 2012/07/17 00:21:26 UTC

svn commit: r1362289 - in /giraph/trunk: CHANGELOG src/main/java/org/apache/giraph/examples/IdentityVertex.java src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java

Author: aching
Date: Mon Jul 16 22:21:26 2012
New Revision: 1362289

URL: http://svn.apache.org/viewvc?rev=1362289&view=rev
Log:
GIRAPH-248: Generic IdentityVertex for IO testing (Sean Choi via
aching).


Added:
    giraph/trunk/src/main/java/org/apache/giraph/examples/IdentityVertex.java
    giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java
Modified:
    giraph/trunk/CHANGELOG

Modified: giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/giraph/trunk/CHANGELOG?rev=1362289&r1=1362288&r2=1362289&view=diff
==============================================================================
--- giraph/trunk/CHANGELOG (original)
+++ giraph/trunk/CHANGELOG Mon Jul 16 22:21:26 2012
@@ -2,6 +2,9 @@ Giraph Change Log
 
 Release 0.2.0 - unreleased
 
+  GIRAPH-248: Generic IdentityVertex for IO testing (Sean Choi via
+  aching).
+
   GIRAPH-222: GIRAPH-222 giraph-formats-contrib needs a README (bfem
   via aching).
 

Added: giraph/trunk/src/main/java/org/apache/giraph/examples/IdentityVertex.java
URL: http://svn.apache.org/viewvc/giraph/trunk/src/main/java/org/apache/giraph/examples/IdentityVertex.java?rev=1362289&view=auto
==============================================================================
--- giraph/trunk/src/main/java/org/apache/giraph/examples/IdentityVertex.java (added)
+++ giraph/trunk/src/main/java/org/apache/giraph/examples/IdentityVertex.java Mon Jul 16 22:21:26 2012
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.giraph.examples;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableComparable;
+import org.apache.giraph.graph.EdgeListVertex;
+
+import java.util.Iterator;
+
+/**
+ * User applications can subclass IdentityVertex, which
+ * simply prints the results that have been read for testing IO related
+ * jobs under any inputformat
+ *
+ * @param <I> Vertex index value
+ * @param <V> Vertex value
+ * @param <E> Edge value
+ * @param <M> Message value
+ */
+@SuppressWarnings("rawtypes")
+
+public abstract class IdentityVertex<I extends WritableComparable,
+  V extends Writable, E extends Writable, M extends Writable>
+  extends EdgeListVertex<I, V, E, M> {
+
+  @Override
+  public void compute(Iterator<M> msgIterator) {
+    voteToHalt();
+  }
+}

Added: giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java
URL: http://svn.apache.org/viewvc/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java?rev=1362289&view=auto
==============================================================================
--- giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java (added)
+++ giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleLongDoubleDoubleDoubleIdentityVertex.java Mon Jul 16 22:21:26 2012
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.giraph.examples;
+
+import org.apache.hadoop.io.DoubleWritable;
+import org.apache.hadoop.io.LongWritable;
+
+/**
+ * A simple use of the Identity Vertex for taking care of Long, Double,
+ * Double, Double type Inputformat Good for use with
+ * lib.LongDoubleDoubleAdjacencyListVertexInputFormat
+ */
+
+public class SimpleLongDoubleDoubleDoubleIdentityVertex extends
+  IdentityVertex<LongWritable, DoubleWritable,
+  DoubleWritable, DoubleWritable> { }