incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r988824 - in /incubator/hama/trunk: ./ src/examples/org/apache/hama/examples/ src/java/org/apache/hama/bsp/
Date Wed, 25 Aug 2010 06:16:19 GMT
Author: edwardyoon
Date: Wed Aug 25 06:16:19 2010
New Revision: 988824

URL: http://svn.apache.org/viewvc?rev=988824&view=rev
Log:
Removing duplicate code

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobContext.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Wed Aug 25 06:16:19 2010
@@ -46,6 +46,7 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
     
+    HAMA-283: Removing duplicate code (Filipe Manana via edwardyoon)
     HAMA-277: Add default number of bsp task (edwardyoon)
     HAMA-273: Implement killJob() method for local job (edwardyoon)
     HAMA-271: Add LocalJobRunner (edwardyoon)

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java Wed Aug 25
06:16:19 2010
@@ -91,8 +91,8 @@ public class PiEstimator {
     // BSP job configuration
     HamaConfiguration conf = new HamaConfiguration();
     // Execute locally
-    //conf.set("bsp.master.address", "local");
-    conf.set("bsp.master.address", "slave.udanax.org:40000");
+    conf.set("bsp.master.address", "local");
+    //conf.set("bsp.master.address", "slave.udanax.org:40000");
 
     BSPJob bsp = new BSPJob(conf, PiEstimator.class);
     // Set the job name

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java Wed Aug 25 06:16:19
2010
@@ -41,11 +41,6 @@ public class BSPJobClient extends Config
   public static enum TaskStatusFilter { NONE, KILLED, FAILED, SUCCEEDED, ALL }
   private static final long MAX_JOBPROFILE_AGE = 1000 * 2;
 
-  static {
-    Configuration.addDefaultResource("hama-default.xml");
-    Configuration.addDefaultResource("hama-site.xml");
-  }
-
   class NetworkedJob implements RunningJob {
     JobProfile profile;
     JobStatus status;

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobContext.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobContext.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobContext.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobContext.java Wed Aug 25 06:16:19
2010
@@ -30,11 +30,6 @@ import org.apache.hama.HamaConfiguration
  * running.
  */
 public class BSPJobContext {
-  static{
-    Configuration.addDefaultResource("hama-default.xml");
-    Configuration.addDefaultResource("hama-site.xml");
-  }
-  
   // Put all of the attribute names in here so that BSPJob and JobContext are
   // consistent.  
   protected static final String WORK_CLASS_ATTR = "bsp.work.class";

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java Wed Aug 25 06:16:19 2010
@@ -56,12 +56,6 @@ import org.apache.hama.ipc.JobSubmission
  */
 public class BSPMaster implements JobSubmissionProtocol, InterTrackerProtocol,
     GroomServerManager {
-
-  static {
-    Configuration.addDefaultResource("hama-default.xml");
-    Configuration.addDefaultResource("hama-site.xml");
-  }
-
   public static final Log LOG = LogFactory.getLog(BSPMaster.class);
 
   private Configuration conf;
@@ -751,11 +745,6 @@ public class BSPMaster implements JobSub
 
     try {
       HamaConfiguration conf = new HamaConfiguration();
-      conf.addResource(new Path(
-          "/home/edward/workspace/hama-trunk/conf/hama-default.xml"));
-      conf.addResource(new Path(
-          "/home/edward/workspace/hama-trunk/conf/hama-site.xml"));
-
       BSPMaster master = startMaster(conf);
       master.offerService();
     } catch (Throwable e) {

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java Wed Aug 25 06:16:19
2010
@@ -19,7 +19,6 @@ package org.apache.hama.bsp;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.lang.reflect.Constructor;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
@@ -39,13 +38,10 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.RemoteException;
-import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.net.DNS;
 import org.apache.hadoop.util.DiskChecker;
-import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.hadoop.util.DiskChecker.DiskErrorException;
-import org.apache.hama.Constants;
 import org.apache.hama.HamaConfiguration;
 import org.apache.hama.ipc.InterTrackerProtocol;
 
@@ -54,11 +50,6 @@ public class GroomServer implements Runn
   private static BSPPeer bspPeer;
   private Task task;
 
-  static {
-    Configuration.addDefaultResource("hama-default.xml");
-    Configuration.addDefaultResource("hama-site.xml");
-  }
-
   Configuration conf;
 
   // Constants
@@ -457,10 +448,6 @@ public class GroomServer implements Runn
 
     try {
       Configuration conf = new HamaConfiguration();
-      conf.addResource(new Path(
-          "/home/edward/workspace/hama-trunk/conf/hama-default.xml"));
-      conf.addResource(new Path(
-          "/home/edward/workspace/hama-trunk/conf/hama-site.xml"));
 
       // conf.set(Constants.PEER_PORT, String.valueOf(30000));
       GroomServer groom = GroomServer.constructGroomServer(GroomServer.class,
@@ -478,15 +465,7 @@ public class GroomServer implements Runn
 
   public void launchTask() {
     // TODO: task localizing and execute them.
-    
-    try {
-      LOG.info(">>>>>>>>>>>>> " + systemFS.isFile(new
Path(task.getJobFile())));
-      //LOG.info("bsp.work.class: " + conf.getClass("bsp.work.class", BSP.class));
-    } catch (IOException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-    
+
     /*
      * try { jobConf.addResource(new Path(task.getJobFile().replace("file:",
      * ""))); LOG.info("Job File>>>>> " + task.getJobFile().replace("file:",

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java?rev=988824&r1=988823&r2=988824&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java Wed Aug 25 06:16:19
2010
@@ -158,8 +158,10 @@ public class LocalJobRunner implements J
             Task task = new BSPTask(job.getJobID().getJtIdentifier(), jobFile, tID.toString(),
i, this.conf);
             servers.assignTask(task);
             LOG.info("Adding task '" + tID.toString() + "' for '" + servers.getServerName()
+ "'");
-
+            
+            // TODO not yet implemented
             servers.launchTask();
+            
           } catch (IOException e) {
             e.printStackTrace();
           }



Mime
View raw message