incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1297326 - in /incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph: Edge.java Vertex.java
Date Tue, 06 Mar 2012 02:31:19 GMT
Author: edwardyoon
Date: Tue Mar  6 02:31:19 2012
New Revision: 1297326

URL: http://svn.apache.org/viewvc?rev=1297326&view=rev
Log:
Minor refactor Edge class.

Modified:
    incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java
    incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java

Modified: incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java?rev=1297326&r1=1297325&r2=1297326&view=diff
==============================================================================
--- incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java (original)
+++ incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java Tue Mar  6 02:31:19
2012
@@ -17,26 +17,33 @@
  */
 package org.apache.hama.graph;
 
+/**
+ * The edge class
+ */
 public class Edge {
-  private String name;
-  private String target;
+  private String sourceVertexID;
+  private String destVertexID;
   private int cost;
 
-  public Edge(String name,String target, int cost) {
-    this.name = name;
-    this.target = target;
+  public Edge(String sourceVertexID, String destVertexID, int cost) {
+    this.sourceVertexID = sourceVertexID;
+    this.destVertexID = destVertexID;
     this.cost = cost;
   }
 
   public String getName() {
-    return name;
+    return sourceVertexID;
+  }
+
+  public String getDestVertexID() {
+    return destVertexID;
   }
-  
+
   public int getCost() {
     return cost;
   }
 
-  public String getTarget() {
-    return target;
+  public String toString() {
+    return this.getDestVertexID() + ":" + this.getCost();
   }
 }

Modified: incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java?rev=1297326&r1=1297325&r2=1297326&view=diff
==============================================================================
--- incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java (original)
+++ incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java Tue Mar  6
02:31:19 2012
@@ -47,7 +47,7 @@ public abstract class Vertex<M extends W
     MapWritable message = new MapWritable();
     message.put(new Text(e.getName()), msg);
 
-    peer.send(e.getTarget(), message);
+    peer.send(e.getDestVertexID(), message);
   }
 
   @Override



Mime
View raw message