You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2010/12/03 08:59:30 UTC

svn commit: r1041720 - in /incubator/hama/trunk/src/java/org/apache/hama/bsp: BSPJobClient.java BSPMaster.java GroomServer.java GroomServerAction.java ReinitGroomAction.java ReinitTrackerAction.java TaskInProgress.java

Author: edwardyoon
Date: Fri Dec  3 07:59:30 2010
New Revision: 1041720

URL: http://svn.apache.org/viewvc?rev=1041720&view=rev
Log:
Renaming some methods in BSPJobClient to follow the Hama terminology

Added:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitGroomAction.java
Removed:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitTrackerAction.java
Modified:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.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/GroomServerAction.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java

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=1041720&r1=1041719&r2=1041720&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 Fri Dec  3 07:59:30 2010
@@ -459,7 +459,7 @@ public class BSPJobClient extends Config
     String cmd = args[0];
     boolean listJobs = false;
     boolean listAllJobs = false;
-    boolean listActiveTrackers = false;
+    boolean listActiveGrooms = false;
     boolean killJob = false;
     String jobid = null;
     
@@ -481,7 +481,7 @@ public class BSPJobClient extends Config
         displayUsage(cmd);
         return exitCode;
       }
-      listActiveTrackers = true;
+      listActiveGrooms = true;
     } else if ("-kill".equals(cmd)) {
       if (args.length == 1) {
         displayUsage(cmd);
@@ -498,8 +498,8 @@ public class BSPJobClient extends Config
     } else if (listAllJobs) {
       listAllJobs();
       exitCode = 0;
-    } else if (listActiveTrackers) {
-      listActiveTrackers();
+    } else if (listActiveGrooms) {
+      listActiveGrooms();
       exitCode = 0;
     } else if (killJob) {
       RunningJob job = jc.getJob(new BSPJobID().forName(jobid));
@@ -598,13 +598,13 @@ public class BSPJobClient extends Config
   }
 
   /**
-   * Display the list of active trackers
+   * Display the list of active groom servers
    */
-  private void listActiveTrackers() throws IOException {
+  private void listActiveGrooms() throws IOException {
     ClusterStatus c = jobSubmitClient.getClusterStatus(true);
-    Map<String, String> trackers = c.getActiveGroomNames();
-    for (String trackerName : trackers.keySet()) {
-      System.out.println(trackerName);
+    Map<String, String> grooms = c.getActiveGroomNames();
+    for (String groomName : grooms.keySet()) {
+      System.out.println(groomName);
     }
   }
 

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=1041720&r1=1041719&r2=1041720&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 Fri Dec  3 07:59:30 2010
@@ -273,10 +273,10 @@ public class BSPMaster implements JobSub
 
   public static BSPMaster startMaster(HamaConfiguration conf)
       throws IOException, InterruptedException {
-    return startTracker(conf, generateNewIdentifier());
+    return startMaster(conf, generateNewIdentifier());
   }
 
-  public static BSPMaster startTracker(HamaConfiguration conf, String identifier)
+  public static BSPMaster startMaster(HamaConfiguration conf, String identifier)
       throws IOException, InterruptedException {
 
     BSPMaster result = new BSPMaster(conf, identifier);
@@ -355,7 +355,7 @@ public class BSPMaster implements JobSub
         groomToHeartbeatResponseMap.remove(groomName);
       }
       return new HeartbeatResponse(newResponseId,
-          new GroomServerAction[] { new ReinitTrackerAction() },
+          new GroomServerAction[] { new ReinitGroomAction() },
           Collections.<String, String>emptyMap());
     }
 
@@ -366,7 +366,7 @@ public class BSPMaster implements JobSub
     if (acceptNewTasks) {
       GroomServerStatus groomStatus = getGroomServer(groomName);
       if (groomStatus == null) {
-        LOG.warn("Unknown task tracker polling; ignoring: " + groomName);
+        LOG.warn("Unknown groom server polling; ignoring: " + groomName);
       } else {
         List<Task> taskList = taskScheduler.assignTasks(groomStatus);
 
@@ -432,14 +432,14 @@ public class BSPMaster implements JobSub
   }
 
   private void removeTaskEntry(String taskid) {
-    // taskid --> tracker
-    String tracker = taskIdToGroomNameMap.remove(taskid);
+    // taskid --> groom
+    String groom = taskIdToGroomNameMap.remove(taskid);
 
-    // tracker --> taskid
-    if (tracker != null) {
-      TreeSet<String> trackerSet = groomNameToTaskIdsMap.get(tracker);
-      if (trackerSet != null) {
-        trackerSet.remove(taskid);
+    // groom --> taskid
+    if (groom != null) {
+      TreeSet<String> groomSet = groomNameToTaskIdsMap.get(groom);
+      if (groomSet != null) {
+        groomSet.remove(taskid);
       }
     }
 
@@ -457,7 +457,7 @@ public class BSPMaster implements JobSub
         TaskInProgress tip = (TaskInProgress) taskIdToTaskInProgressMap.get(killTaskId);
         if (tip.shouldCloseForClosedJob(killTaskId)) {
           // 
-          // This is how the JobTracker ends a task at the TaskTracker.
+          // This is how the BSPMaster ends a task at the GroomServer.
           // It may be successfully completed, or may be killed in
           // mid-execution.
           //
@@ -689,12 +689,12 @@ public class BSPMaster implements JobSub
   public void createTaskEntry(String taskid, String groomServer,
       TaskInProgress taskInProgress) {
     LOG.info("Adding task '" + taskid + "' to tip " + taskInProgress.getTIPId()
-        + ", for tracker '" + groomServer + "'");
+        + ", for groom '" + groomServer + "'");
 
-    // taskid --> tracker
+    // taskid --> groom
     taskIdToGroomNameMap.put(taskid, groomServer);
 
-    // tracker --> taskid
+    // groom --> taskid
     TreeSet<String> taskset = groomNameToTaskIdsMap.get(groomServer);
     if (taskset == null) {
       taskset = new TreeSet<String>();

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=1041720&r1=1041719&r2=1041720&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 Fri Dec  3 07:59:30 2010
@@ -258,7 +258,7 @@ public class GroomServer implements Runn
         LOG.info("Interrupted. Closing down.");
         return State.INTERRUPTED;
       } catch (DiskErrorException de) {
-        String msg = "Exiting task tracker for disk error:\n"
+        String msg = "Exiting groom server for disk error:\n"
             + StringUtils.stringifyException(de);
         LOG.error(msg);
 

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServerAction.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServerAction.java?rev=1041720&r1=1041719&r2=1041720&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServerAction.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServerAction.java Fri Dec  3 07:59:30 2010
@@ -79,7 +79,7 @@ abstract class GroomServerAction impleme
       break;
     case REINIT_GROOM:
       {
-        action = new ReinitTrackerAction();
+        action = new ReinitGroomAction();
       }
       break;
     case COMMIT_TASK:

Added: incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitGroomAction.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitGroomAction.java?rev=1041720&view=auto
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitGroomAction.java (added)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/ReinitGroomAction.java Fri Dec  3 07:59:30 2010
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hama.bsp;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * Represents a directive from the {@link org.apache.hama.bsp.BSPMaster} to the
+ * {@link org.apache.hama.bsp.GroomServer} to reinitialize itself.
+ * 
+ */
+class ReinitGroomAction extends GroomServerAction {
+
+  public ReinitGroomAction() {
+    super(ActionType.REINIT_GROOM);
+  }
+
+  public void write(DataOutput out) throws IOException {
+  }
+
+  public void readFields(DataInput in) throws IOException {
+  }
+
+}

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java?rev=1041720&r1=1041719&r2=1041720&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java Fri Dec  3 07:59:30 2010
@@ -105,7 +105,7 @@ class TaskInProgress {
     t = new BSPTask(jobId, jobFile, taskid, partition);
     activeTasks.put(taskid, status.getGroomName());
 
-    // Ask JobTracker to note that the task exists
+    // Ask BSPMaster to note that the task exists
     bspMaster.createTaskEntry(taskid, status.getGroomName(), this);
     return t;
   }
@@ -184,7 +184,7 @@ class TaskInProgress {
 
     //
     // Now that the TIP is complete, the other speculative
-    // subtasks will be closed when the owning tasktracker
+    // subtasks will be closed when the owning groom server
     // reports in and calls shouldClose() on this object.
     //