hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1403136 - in /hama/trunk: examples/src/main/java/org/apache/hama/examples/ graph/src/main/java/org/apache/hama/graph/
Date Mon, 29 Oct 2012 01:06:33 GMT
Author: edwardyoon
Date: Mon Oct 29 01:06:33 2012
New Revision: 1403136

URL: http://svn.apache.org/viewvc?rev=1403136&view=rev
Log:
HAMA-655: Add Exception handling for parsing of vertex

Modified:
    hama/trunk/examples/src/main/java/org/apache/hama/examples/BipartiteMatching.java
    hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
    hama/trunk/examples/src/main/java/org/apache/hama/examples/MindistSearch.java
    hama/trunk/examples/src/main/java/org/apache/hama/examples/PageRank.java
    hama/trunk/examples/src/main/java/org/apache/hama/examples/SSSP.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/BipartiteMatching.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/BipartiteMatching.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/BipartiteMatching.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/BipartiteMatching.java Mon
Oct 29 01:06:33 2012
@@ -175,7 +175,7 @@ public final class BipartiteMatching {
 
     @Override
     public boolean parseVertex(LongWritable key, Text value,
-        Vertex<Text, NullWritable, TextPair> vertex) {
+        Vertex<Text, NullWritable, TextPair> vertex) throws Exception {
 
       String[] tokenArray = value.toString().split(":");
       String[] adjArray = tokenArray[1].trim().split(" ");

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java Mon Oct 29
01:06:33 2012
@@ -64,7 +64,7 @@ public class InlinkCount extends Vertex<
      */
     @Override
     public boolean parseVertex(LongWritable key, Text value,
-        Vertex<Text, NullWritable, IntWritable> vertex) {
+        Vertex<Text, NullWritable, IntWritable> vertex) throws Exception {
       String[] split = value.toString().split("\t");
       for (int i = 0; i < split.length; i++) {
         if (i == 0) {

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/MindistSearch.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/MindistSearch.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/MindistSearch.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/MindistSearch.java Mon Oct
29 01:06:33 2012
@@ -110,7 +110,7 @@ public class MindistSearch {
      */
     @Override
     public boolean parseVertex(LongWritable key, Text value,
-        Vertex<Text, NullWritable, Text> vertex) {
+        Vertex<Text, NullWritable, Text> vertex) throws Exception {
       String[] split = value.toString().split("\t");
       for (int i = 0; i < split.length; i++) {
         if (i == 0) {

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/PageRank.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/PageRank.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/PageRank.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/PageRank.java Mon Oct 29 01:06:33
2012
@@ -112,7 +112,7 @@ public class PageRank {
      */
     @Override
     public boolean parseVertex(LongWritable key, Text value,
-        Vertex<Text, NullWritable, DoubleWritable> vertex) {
+        Vertex<Text, NullWritable, DoubleWritable> vertex) throws Exception {
       String[] split = value.toString().split("\t");
       for (int i = 0; i < split.length; i++) {
         if (i == 0) {

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/SSSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/SSSP.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/SSSP.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/SSSP.java Mon Oct 29 01:06:33
2012
@@ -102,7 +102,7 @@ public class SSSP {
      */
     @Override
     public boolean parseVertex(LongWritable key, Text value,
-        Vertex<Text, IntWritable, IntWritable> vertex) {
+        Vertex<Text, IntWritable, IntWritable> vertex) throws Exception {
       String[] split = value.toString().split("\t");
       for (int i = 0; i < split.length; i++) {
         if (i == 0) {

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java Mon Oct 29 01:06:33
2012
@@ -299,8 +299,15 @@ public final class GraphJobRunner<V exte
     KeyValuePair<Writable, Writable> next = null;
     int steps = 1;
     while ((next = peer.readNext()) != null) {
-      boolean vertexFinished = reader.parseVertex(next.getKey(),
-          next.getValue(), vertex);
+      boolean vertexFinished = false;
+      try {
+        vertexFinished = reader.parseVertex(next.getKey(), next.getValue(),
+            vertex);
+      } catch (Exception e) {
+        //LOG.error("exception occured during parsing vertex!" + e.toString());
+        throw new IOException("exception occured during parsing vertex!" + e.toString());
+      }
+      
       if (!vertexFinished) {
         continue;
       }

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java?rev=1403136&r1=1403135&r2=1403136&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java Mon Oct 29
01:06:33 2012
@@ -30,6 +30,6 @@ public abstract class VertexInputReader<
    * next call.
    */
   public abstract boolean parseVertex(KEYIN key, VALUEIN value,
-      Vertex<V, E, M> vertex);
+      Vertex<V, E, M> vertex) throws Exception;
 
 }



Mime
View raw message