hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1551092 - /hama/trunk/examples/src/main/java/org/apache/hama/examples/Kmeans.java
Date Mon, 16 Dec 2013 00:48:03 GMT
Author: edwardyoon
Date: Mon Dec 16 00:48:02 2013
New Revision: 1551092

URL: http://svn.apache.org/r1551092
Log:
Minor refactor

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

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/Kmeans.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/Kmeans.java?rev=1551092&r1=1551091&r2=1551092&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/Kmeans.java (original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/Kmeans.java Mon Dec 16 00:48:02
2013
@@ -62,7 +62,7 @@ public class Kmeans {
       return;
     }
     HamaConfiguration conf = new HamaConfiguration();
-    
+
     Path in = new Path(args[0]);
     Path out = new Path(args[1]);
     FileSystem fs = FileSystem.get(conf);
@@ -94,12 +94,18 @@ public class Kmeans {
 
     BSPJob job = KMeansBSP.createJob(conf, in, out, true);
 
+    long startTime = System.currentTimeMillis();
     // just submit the job
-    job.waitForCompletion(true);
+    if (job.waitForCompletion(true)) {
+      System.out.println("Job Finished in "
+          + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");
+    }
 
-    List<String> results = KMeansBSP.readOutput(conf, out, fs, 10);
+    System.out.println("\nHere are a few lines of output:");
+    List<String> results = KMeansBSP.readOutput(conf, out, fs, 4);
     for (String line : results) {
       System.out.println(line);
     }
+    System.out.println("...");
   }
 }



Mime
View raw message