incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1201695 - in /incubator/hama/trunk: core/src/test/java/org/apache/hama/bsp/ core/src/test/java/org/apache/hama/examples/ core/src/test/java/testjar/ examples/src/main/java/org/apache/hama/examples/ examples/src/main/java/org/apache/hama/ex...
Date Mon, 14 Nov 2011 13:31:46 GMT
Author: edwardyoon
Date: Mon Nov 14 13:31:46 2011
New Revision: 1201695

URL: http://svn.apache.org/viewvc?rev=1201695&view=rev
Log:
Move low-quality examples to test package.

Added:
    incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/
    incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/ClassSerializePrinting.java
      - copied, changed from r1201689, incubator/hama/trunk/core/src/test/java/testjar/ClassSerializePrinting.java
    incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/CombineExample.java
      - copied, changed from r1201689, incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/CombineExample.java
    incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/RandBench.java
      - copied unchanged from r1201689, incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/RandBench.java
Removed:
    incubator/hama/trunk/core/src/test/java/testjar/
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/CombineExample.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/RandBench.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/SerializePrinting.java
Modified:
    incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPMasterGroomServer.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/graph/ShortestPaths.java

Modified: incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPMasterGroomServer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPMasterGroomServer.java?rev=1201695&r1=1201694&r2=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPMasterGroomServer.java
(original)
+++ incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPMasterGroomServer.java
Mon Nov 14 13:31:46 2011
@@ -55,9 +55,11 @@ public class TestBSPMasterGroomServer ex
   }
 
   public void testSubmitJob() throws Exception {
-    BSPJob bsp = new BSPJob(configuration, testjar.ClassSerializePrinting.HelloBSP.class);
+    BSPJob bsp = new BSPJob(configuration,
+        org.apache.hama.examples.ClassSerializePrinting.HelloBSP.class);
     bsp.setJobName("Test Serialize Printing");
-    bsp.setBspClass(testjar.ClassSerializePrinting.HelloBSP.class);
+    bsp
+        .setBspClass(org.apache.hama.examples.ClassSerializePrinting.HelloBSP.class);
 
     // Set the task size as a number of GroomServer
     BSPJobClient jobClient = new BSPJobClient(configuration);
@@ -65,7 +67,7 @@ public class TestBSPMasterGroomServer ex
     ClusterStatus cluster = jobClient.getClusterStatus(false);
     assertEquals(this.numOfGroom, cluster.getGroomServers());
     bsp.setNumBspTask(2);
-    
+
     FileSystem fileSys = FileSystem.get(conf);
 
     if (bsp.waitForCompletion(true)) {
@@ -78,7 +80,7 @@ public class TestBSPMasterGroomServer ex
       int tasks) throws Exception {
     for (int i = 0; i < tasks; i++) {
       SequenceFile.Reader reader = new SequenceFile.Reader(fileSys, new Path(
-          TMP_OUTPUT + "part-0000" +i), conf);
+          TMP_OUTPUT + "part-0000" + i), conf);
       LongWritable timestamp = new LongWritable();
       Text message = new Text();
       reader.next(timestamp, message);

Copied: incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/ClassSerializePrinting.java
(from r1201689, incubator/hama/trunk/core/src/test/java/testjar/ClassSerializePrinting.java)
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/ClassSerializePrinting.java?p2=incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/ClassSerializePrinting.java&p1=incubator/hama/trunk/core/src/test/java/testjar/ClassSerializePrinting.java&r1=1201689&r2=1201695&rev=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/test/java/testjar/ClassSerializePrinting.java (original)
+++ incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/ClassSerializePrinting.java
Mon Nov 14 13:31:46 2011
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package testjar;
+package org.apache.hama.examples;
 
 import java.io.IOException;
 

Copied: incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/CombineExample.java
(from r1201689, incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/CombineExample.java)
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/CombineExample.java?p2=incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/CombineExample.java&p1=incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/CombineExample.java&r1=1201689&r2=1201695&rev=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/CombineExample.java
(original)
+++ incubator/hama/trunk/core/src/test/java/org/apache/hama/examples/CombineExample.java Mon
Nov 14 13:31:46 2011
@@ -82,7 +82,7 @@ public class CombineExample {
     // BSP job configuration
     HamaConfiguration conf = new HamaConfiguration();
 
-    BSPJob bsp = new BSPJob(conf, PiEstimator.class);
+    BSPJob bsp = new BSPJob(conf, CombineExample.class);
     // Set the job name
     bsp.setJobName("Combine Example");
     bsp.setBspClass(MyBSP.class);

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java?rev=1201695&r1=1201694&r2=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
Mon Nov 14 13:31:46 2011
@@ -27,9 +27,6 @@ public class ExampleDriver {
     ProgramDriver pgd = new ProgramDriver();
     try {
       pgd.addClass("pi", PiEstimator.class, "Pi Estimator");
-      pgd.addClass("bench", RandBench.class, "Random Communication Benchmark");
-      pgd.addClass("test", SerializePrinting.class, "Serialize Printing Test");
-      pgd.addClass("combine", CombineExample.class, "Combiner Example");
 
       pgd.driver(args);
     } catch (Throwable e) {

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java?rev=1201695&r1=1201694&r2=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java
Mon Nov 14 13:31:46 2011
@@ -88,9 +88,8 @@ public class PiEstimator {
     public void setup(
         BSPPeer<NullWritable, NullWritable, Text, DoubleWritable> peer) {
       // Choose one as a master
-      this.masterTask = peer.getPeerName(0);
+      this.masterTask = peer.getPeerName(peer.getNumPeers() / 2);
     }
-
   }
 
   private static void printOutput(HamaConfiguration conf) throws IOException {

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/graph/ShortestPaths.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/graph/ShortestPaths.java?rev=1201695&r1=1201694&r2=1201695&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/graph/ShortestPaths.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/graph/ShortestPaths.java
Mon Nov 14 13:31:46 2011
@@ -39,7 +39,6 @@ import org.apache.hama.bsp.ClusterStatus
 import org.apache.hama.bsp.IntegerMessage;
 import org.apache.hama.bsp.OutputCollector;
 import org.apache.hama.bsp.RecordReader;
-import org.apache.hama.examples.RandBench;
 import org.apache.zookeeper.KeeperException;
 
 public class ShortestPaths extends ShortestPathsBase {
@@ -201,7 +200,7 @@ public class ShortestPaths extends Short
     if (adjacencyListPath == null)
       adjacencyList = ShortestPathsGraphLoader.loadGraph();
 
-    BSPJob bsp = new BSPJob(conf, RandBench.class);
+    BSPJob bsp = new BSPJob(conf, ShortestPaths.class);
     // Set the job name
     bsp.setJobName("Single Source Shortest Path");
     bsp.setBspClass(ShortestPaths.class);



Mime
View raw message