hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1419324 - /hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java
Date Mon, 10 Dec 2012 10:18:22 GMT
Author: edwardyoon
Date: Mon Dec 10 10:18:21 2012
New Revision: 1419324

URL: http://svn.apache.org/viewvc?rev=1419324&view=rev
Log:
Fix small bug.

Modified:
    hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java?rev=1419324&r1=1419323&r2=1419324&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java
(original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/util/SymmetricMatrixGen.java
Mon Dec 10 10:18:21 2012
@@ -82,6 +82,12 @@ public class SymmetricMatrixGen {
           boolean nonZero = new Random().nextInt(density) == 0;
           if (nonZero && !edges.contains(j) && i != j) {
             edges.add(j);
+            
+            // TODO please refactor this.
+            int peerIndex = j / interval;
+            if(peerIndex == peer.getNumPeers())
+              peerIndex = peerIndex - 1;
+            
             peer.send(peer.getPeerName(j / interval), new Text(j + "," + i));
           }
         }



Mime
View raw message