hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1555025 - in /hama/trunk/examples/src: main/java/org/apache/hama/examples/SpMV.java test/java/org/apache/hama/examples/SpMVTest.java
Date Fri, 03 Jan 2014 07:49:42 GMT
Author: edwardyoon
Date: Fri Jan  3 07:49:42 2014
New Revision: 1555025

URL: http://svn.apache.org/r1555025
Log:
Add trace code.

Modified:
    hama/trunk/examples/src/main/java/org/apache/hama/examples/SpMV.java
    hama/trunk/examples/src/test/java/org/apache/hama/examples/SpMVTest.java

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/SpMV.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/SpMV.java?rev=1555025&r1=1555024&r2=1555025&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/SpMV.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/SpMV.java Fri Jan  3 07:49:42
2014
@@ -282,6 +282,7 @@ public class SpMV {
     } else if (fs.isFile(path)) {
       filePaths.add(path.toString());
     }
+
     try {
       for (String filePath : filePaths) {
         reader = new SequenceFile.Reader(fs, new Path(filePath), conf);

Modified: hama/trunk/examples/src/test/java/org/apache/hama/examples/SpMVTest.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/test/java/org/apache/hama/examples/SpMVTest.java?rev=1555025&r1=1555024&r2=1555025&view=diff
==============================================================================
--- hama/trunk/examples/src/test/java/org/apache/hama/examples/SpMVTest.java (original)
+++ hama/trunk/examples/src/test/java/org/apache/hama/examples/SpMVTest.java Fri Jan  3 07:49:42
2014
@@ -46,13 +46,15 @@ public class SpMVTest {
 
   protected static final Log LOG = LogFactory.getLog(SpMVTest.class);
 
-  private HamaConfiguration conf;
-  private String baseDir;
-
+  private static HamaConfiguration conf;
+  private static String baseDir;
+  private static FileSystem fs;
+  
   @Before
   public void prepare() throws IOException {
     conf = new HamaConfiguration();
     baseDir = "/tmp/spmv";
+    fs = FileSystem.get(conf);
   }
 
   /**
@@ -130,6 +132,10 @@ public class SpMVTest {
       DenseVectorWritable result = new DenseVectorWritable();
       SpMV.readFromFile(resultPath, result, conf);
 
+      LOG.info(resultPath +": " + fs.exists(new Path(resultPath)));
+      LOG.info(fs.getLength(new Path(resultPath)));
+      LOG.info(">>>>>>>>>>> " + result);
+      
       double expected[] = { 38, 12, 24, 11 };
       if (result.getSize() != size)
         throw new Exception("Incorrect size of output vector");
@@ -197,7 +203,6 @@ public class SpMVTest {
   public static void writeMatrix(String pathString, Configuration conf,
       Map<Integer, Writable> matrix) throws IOException {
     boolean inited = false;
-    FileSystem fs = FileSystem.get(conf);
     SequenceFile.Writer writer = null;
     try {
       for (Integer index : matrix.keySet()) {



Mime
View raw message