hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r724274 - in /incubator/hama/trunk: CHANGES.txt src/java/org/apache/hama/DenseMatrix.java src/test/org/apache/hama/TestDenseMatrix.java
Date Mon, 08 Dec 2008 07:45:39 GMT
Author: edwardyoon
Date: Sun Dec  7 23:45:38 2008
New Revision: 724274

URL: http://svn.apache.org/viewvc?rev=724274&view=rev
Log:
In random_mapred(), IntWritable(m) should be IntWritable(m-1) since start from 0.

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/java/org/apache/hama/DenseMatrix.java
    incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=724274&r1=724273&r2=724274&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Sun Dec  7 23:45:38 2008
@@ -86,6 +86,8 @@
 
   BUG FIXES
    
+    HAMA-126: In random_mapred, (m) should be (m-1) 
+                since start from 0. (edwardyoon)
     HAMA-116: ArrayIndexOutOfBoundsException at BlockingMapRed (samuel)
     HAMA-112: DenseMatrix.get(i, j) should returns zero 
                 when entry is null (edwardyoon)

Modified: incubator/hama/trunk/src/java/org/apache/hama/DenseMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/DenseMatrix.java?rev=724274&r1=724273&r2=724274&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/DenseMatrix.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/DenseMatrix.java Sun Dec  7 23:45:38 2008
@@ -283,7 +283,7 @@
       if((i + 1) != conf.getNumMapTasks()) {
         end = new IntWritable(((i * interval) + interval) - 1);        
       } else {
-        end = new IntWritable(m);       
+        end = new IntWritable(m - 1);       
       }
       final SequenceFile.Writer writer = SequenceFile.createWriter(fs, jobConf,
           file, IntWritable.class, IntWritable.class, CompressionType.NONE);

Modified: incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java?rev=724274&r1=724273&r2=724274&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java Sun Dec  7 23:45:38
2008
@@ -352,6 +352,8 @@
   
   public void testRandomMatrixMapReduce() throws IOException {
     DenseMatrix rand = DenseMatrix.random_mapred(conf, 20, 20);
+    assertEquals(rand.getRows(), 20);
+    assertEquals(rand.getColumns(), 20);
     for(int i = 0; i < rand.getRows(); i++) {
       for(int j = 0; j < rand.getColumns(); j++) {
         assertTrue(rand.get(i, j) > -1);



Mime
View raw message