hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1092554 - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/ mr-clie...
Date Fri, 15 Apr 2011 00:36:16 GMT
Author: mahadev
Date: Fri Apr 15 00:36:15 2011
New Revision: 1092554

URL: http://svn.apache.org/viewvc?rev=1092554&view=rev
Log:
WebApp for Job History

Added:
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSParams.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSWebApp.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsController.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java
Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/App.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryContext.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistory.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Fri Apr 15 00:36:15 2011
@@ -12,6 +12,8 @@ Trunk (unreleased changes)
 
    Install sanitized poms for downstream sanity (Luke Lu via mahadev)
 
+   WebApp for Job History (Krishna Ramachandran via mahadev)
+
   INCOMPATIBLE CHANGES
 
     MAPREDUCE-1866. Removes deprecated class

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/App.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/App.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/App.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/App.java
Fri Apr 15 00:36:15 2011
@@ -26,7 +26,7 @@ import org.apache.hadoop.mapreduce.v2.ap
 import org.apache.hadoop.mapreduce.v2.app.job.Task;
 
 @RequestScoped
-class App {
+public class App {
   final AppContext context;
   Job job;
   Task task;

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java
Fri Apr 15 00:36:15 2011
@@ -35,13 +35,19 @@ import com.google.inject.Inject;
 
 public class AppController extends Controller implements AMParams {
   final App app;
-
-  @Inject AppController(App app, Configuration conf, RequestContext ctx) {
+  
+  protected AppController(App app, Configuration conf, RequestContext ctx,
+      String title) {
     super(ctx);
     this.app = app;
     set(APP_ID, Apps.toString(app.context.getApplicationID()));
-    set(RM_WEB, join("http://", 
-        conf.get(YarnConfiguration.RM_WEBAPP_BIND_ADDRESS, "localhost:8888")));
+    set(RM_WEB, join("http://", conf.get(
+        YarnConfiguration.RM_WEBAPP_BIND_ADDRESS, "localhost:8888")));
+  }
+
+  @Inject
+  protected AppController(App app, Configuration conf, RequestContext ctx) {
+    this(app, conf, ctx, "am");
   }
 
   @Override public void index() {

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java
Fri Apr 15 00:36:15 2011
@@ -32,7 +32,7 @@ import org.apache.hadoop.yarn.webapp.vie
 import static org.apache.hadoop.yarn.util.StringHelper.*;
 import static org.apache.hadoop.yarn.webapp.view.JQueryUI.*;
 
-class TaskPage extends AppView {
+public class TaskPage extends AppView {
 
   static class AttemptsBlock extends HtmlBlock {
     final App app;

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
Fri Apr 15 00:36:15 2011
@@ -57,8 +57,10 @@ import org.apache.hadoop.mapreduce.v2.ap
 import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
 import org.apache.hadoop.mapreduce.v2.app.job.Job;
 import org.apache.hadoop.mapreduce.v2.app.job.Task;
+import org.apache.hadoop.mapreduce.v2.hs.webapp.HSWebApp;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.yarn.YarnException;
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
 import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
@@ -66,6 +68,7 @@ import org.apache.hadoop.yarn.ipc.RPCUti
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import org.apache.hadoop.yarn.service.AbstractService;
 import org.apache.hadoop.yarn.webapp.WebApp;
+import org.apache.hadoop.yarn.webapp.WebApps;
 import org.apache.hadoop.mapreduce.v2.YarnMRJobConfig;
 
 /**
@@ -92,6 +95,7 @@ public class HistoryClientService extend
   public void start() {
     Configuration conf = new Configuration(getConfig());
     YarnRPC rpc = YarnRPC.create(conf);
+    initializeWebApp(conf);
     String serviceAddr = conf.get(YarnMRJobConfig.HS_BIND_ADDRESS,
         YarnMRJobConfig.DEFAULT_HS_BIND_ADDRESS);
     InetSocketAddress address = NetUtils.createSocketAddr(serviceAddr);
@@ -116,6 +120,13 @@ public class HistoryClientService extend
     super.start();
   }
 
+  private void initializeWebApp(Configuration conf) {
+    webApp = new HSWebApp(history);
+    String bindAddress = conf.get(YarnMRJobConfig.HS_WEBAPP_BIND_ADDRESS,
+        YarnMRJobConfig.DEFAULT_HS_WEBAPP_BIND_ADDRESS);
+    WebApps.$for("yarn", this).at(bindAddress).start(webApp); 
+  }
+
   @Override
   public void stop() {
     if (server != null) {
@@ -182,7 +193,6 @@ public class HistoryClientService extend
       int maxEvents = request.getMaxEvents();
       
       Job job = getJob(jobId);
-      
       GetTaskAttemptCompletionEventsResponse response = recordFactory.newRecordInstance(GetTaskAttemptCompletionEventsResponse.class);
       response.addAllCompletionEvents(Arrays.asList(job.getTaskAttemptCompletionEvents(fromEventId,
maxEvents)));
       return response;
@@ -241,4 +251,5 @@ public class HistoryClientService extend
     }
 
   }
+
 }

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryContext.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryContext.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryContext.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryContext.java
Fri Apr 15 00:36:15 2011
@@ -20,14 +20,17 @@ package org.apache.hadoop.mapreduce.v2.h
 
 import java.util.Map;
 
+import org.apache.hadoop.mapreduce.v2.app.AppContext;
 import org.apache.hadoop.mapreduce.v2.app.job.Job;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.mapreduce.v2.api.records.JobId;
 
-public interface HistoryContext {
+public interface HistoryContext extends AppContext {
 
   Job getJob(JobId id);
 
   Map<JobId, Job> getAllJobs(ApplicationId appID);
 
+  Map<JobId, Job> getAllJobs();
+
 }

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistory.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistory.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistory.java
Fri Apr 15 00:36:15 2011
@@ -19,20 +19,37 @@
 package org.apache.hadoop.mapreduce.v2.hs;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileContext;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.LocatedFileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.UnsupportedFileSystemException;
+import org.apache.hadoop.mapreduce.v2.YarnMRJobConfig;
 import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.api.records.JobReport;
+import org.apache.hadoop.mapreduce.JobID;
+import org.apache.hadoop.mapreduce.JobStatus;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.mapreduce.TypeConverter;
 import org.apache.hadoop.mapreduce.v2.app.job.Job;
 import org.apache.hadoop.mapreduce.v2.hs.CompletedJob;
 import org.apache.hadoop.yarn.YarnException;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.conf.YARNApplicationConstants;
+import org.apache.hadoop.yarn.event.EventHandler;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.Clock;
 
 /*
  * Loads and manages the Job history cache.
@@ -42,6 +59,8 @@ public class JobHistory implements Histo
   private Map<JobId, Job> completedJobCache =
     new ConcurrentHashMap<JobId, Job>();
   private Configuration conf;
+  private final ApplicationId appID;
+  private final String userName;
   private final LinkedList<Job> jobQ = new LinkedList<Job>();
   private static final Log LOG = LogFactory.getLog(JobHistory.class);
   private final int retiredJobsCacheSize = 1000; //TODO make it configurable
@@ -49,6 +68,10 @@ public class JobHistory implements Histo
 
   public JobHistory(Configuration conf) {
     this.conf = conf;
+    userName = conf.get(MRJobConfig.USER_NAME, "history-user");
+    //TODO fixme - bogus appID for now
+    this.appID = RecordFactoryProvider.getRecordFactory(conf)
+        .newRecordInstance(ApplicationId.class);
   }
   @Override
   public synchronized Job getJob(JobId jobId) {
@@ -79,4 +102,57 @@ public class JobHistory implements Histo
     jobs.put(jobID, getJob(jobID));
     return jobs;
   }
+  
+  //TODO FIX ME use indexed search so we do not reload the 
+  // previously processed files
+  @Override
+  public Map<JobId, Job> getAllJobs() {
+    //currently there is 1 to 1 mapping between app and job id
+    Map<JobId, Job> jobs = new HashMap<JobId, Job>();
+    String defaultDoneDir = conf.get(
+        YARNApplicationConstants.APPS_STAGING_DIR_KEY) + "/history/done";
+    String  jobhistoryDir =
+      conf.get(YarnMRJobConfig.HISTORY_DONE_DIR_KEY, defaultDoneDir);
+    try {
+      Path done = FileContext.getFileContext(conf).makeQualified(
+          new Path(jobhistoryDir));
+      FileContext doneDirFc = FileContext.getFileContext(done.toUri(), conf);
+      RemoteIterator<LocatedFileStatus> historyFiles = doneDirFc.util()
+          .listFiles(done, true);
+      if (historyFiles != null) {
+        FileStatus f;
+        while (historyFiles.hasNext()) {
+          f = historyFiles.next();
+          if (f.isDirectory()) continue;
+          String jobName = f.getPath().getName();
+          org.apache.hadoop.mapreduce.JobID oldJobID = JobID.forName(jobName);
+          JobId jobID = TypeConverter.toYarn(oldJobID);
+          Job job = new CompletedJob(conf, jobID);
+          jobs.put(jobID, job);
+          completedJobCache.put(jobID, job);
+        }
+      }
+    } catch (IOException ie) {
+      LOG.info("Error while creating historyFileMap" + ie);
+    }
+    return jobs;
+  }
+  @Override
+  public ApplicationId getApplicationID() {
+    return appID;
+  }
+  @Override
+  public EventHandler getEventHandler() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+  @Override
+  public CharSequence getUser() {
+    return userName;
+  }
+  
+ @Override
+ public Clock getClock() {
+   return null;
+ }
 }

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSParams.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSParams.java?rev=1092554&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSParams.java
(added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSParams.java
Fri Apr 15 00:36:15 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.mapreduce.v2.hs.webapp;
+
+interface HSParams {
+  static final String HS_WEB = "hs.web";
+  static final String APP_ID = "app.id";
+  static final String JOB_ID = "job.id";
+  static final String TASK_ID = "task.id";
+  static final String TASK_TYPE = "task.type";
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSWebApp.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSWebApp.java?rev=1092554&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSWebApp.java
(added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HSWebApp.java
Fri Apr 15 00:36:15 2011
@@ -0,0 +1,27 @@
+package org.apache.hadoop.mapreduce.v2.hs.webapp;
+
+import org.apache.hadoop.mapreduce.v2.app.AppContext;
+import org.apache.hadoop.mapreduce.v2.hs.HistoryClientService;
+import org.apache.hadoop.mapreduce.v2.hs.HistoryContext;
+import org.apache.hadoop.yarn.webapp.WebApp;
+import static org.apache.hadoop.yarn.util.StringHelper.*;
+public class HSWebApp extends WebApp implements HSParams {
+
+  private HistoryContext history;
+
+  public HSWebApp(HistoryContext history) {
+    this.history = history;
+  }
+
+  @Override
+  public void setup() {
+    bind(AppContext.class).toInstance(history);
+    route("/", HsController.class);
+    route("/app", HsController.class);
+    route(pajoin("/job", JOB_ID), HsController.class, "job");
+    route(pajoin("/jobcounters", JOB_ID), HsController.class, "jobCounters");
+    route(pajoin("/tasks", JOB_ID, TASK_TYPE), HsController.class, "tasks");
+    route(pajoin("/task", TASK_ID), HsController.class, "task");
+  }
+}
+

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsController.java?rev=1092554&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsController.java
(added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsController.java
Fri Apr 15 00:36:15 2011
@@ -0,0 +1,52 @@
+package org.apache.hadoop.mapreduce.v2.hs.webapp;
+
+import java.util.Locale;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.app.AppContext;
+import org.apache.hadoop.mapreduce.v2.app.job.Job;
+import org.apache.hadoop.mapreduce.v2.app.job.Task;
+import org.apache.hadoop.mapreduce.v2.app.webapp.App;
+import org.apache.hadoop.mapreduce.v2.app.webapp.AppController;
+import org.apache.hadoop.mapreduce.v2.app.webapp.CountersPage;
+import org.apache.hadoop.mapreduce.v2.app.webapp.JobPage;
+import org.apache.hadoop.mapreduce.v2.app.webapp.TasksPage;
+import org.apache.hadoop.mapreduce.v2.hs.HistoryContext;
+import org.apache.commons.lang.StringUtils;
+import org.apache.hadoop.yarn.webapp.Controller;
+import org.apache.hadoop.mapreduce.v2.util.MRApps;
+
+import static org.apache.hadoop.yarn.util.StringHelper.join;
+import com.google.inject.Inject;
+
+public class HsController extends AppController implements HSParams {
+  
+  @Inject HsController(App app, Configuration conf, RequestContext ctx) {
+    super(app, conf, ctx, "History");
+  }
+
+  @Override
+  public void index() {
+    // TODO Auto-generated method stub
+    setTitle("JobHistory");
+  }
+
+  public void job() {
+    super.job();
+  }
+
+  public void jobCounters() {
+    super.jobCounters();
+  }
+
+  public void tasks() {
+    super.tasks();
+  }
+  
+  public void task() {
+    super.task();
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java?rev=1092554&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java
(added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java
Fri Apr 15 00:36:15 2011
@@ -0,0 +1,46 @@
+package org.apache.hadoop.mapreduce.v2.hs.webapp;
+
+import org.apache.hadoop.mapreduce.v2.app.webapp.JobsBlock;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.view.TwoColumnLayout;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.*;
+
+public class HsView extends TwoColumnLayout {
+  @Override protected void preHead(Page.HTML<_> html) {
+    commonPreHead(html);
+    set(DATATABLES_ID, "jobs");
+    set(initID(DATATABLES, "jobs"), jobsTableInit());
+    setTableStyles(html, "jobs");
+  }
+
+  protected void commonPreHead(Page.HTML<_> html) {
+    //html.meta_http("refresh", "10");
+    set(ACCORDION_ID, "nav");
+    set(initID(ACCORDION, "nav"), "{autoHeight:false, active:1}");
+    set(THEMESWITCHER_ID, "themeswitcher");
+  }
+
+  /*
+   * (non-Javadoc)
+   * @see org.apache.hadoop.yarn.webapp.view.TwoColumnLayout#nav()
+   */
+
+  @Override
+  protected Class<? extends SubView> nav() {
+    return org.apache.hadoop.mapreduce.v2.app.webapp.NavBlock.class;
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return JobsBlock.class;
+  }
+
+  private String jobsTableInit() {
+    return tableInit().
+        append(",aoColumns:[{sType:'title-numeric'},").
+        append("null,null,{sType:'title-numeric', bSearchable:false},null,").
+        append("null,{sType:'title-numeric',bSearchable:false}, null, null]}").
+        toString();
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java?rev=1092554&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java
(added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java
Fri Apr 15 00:36:15 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.mapreduce.v2.hs.webapp;
+
+import org.apache.hadoop.yarn.webapp.WebApps;
+
+public class TestHSWebApp {
+  public static void main(String[] args) {
+    WebApps.$for("yarn").at(19888).start().joinThread();
+  }
+}

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java?rev=1092554&r1=1092553&r2=1092554&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
Fri Apr 15 00:36:15 2011
@@ -39,7 +39,8 @@ import org.junit.Test;
 
 public class TestMRJobsWithHistoryService {
 
-  private static final Log LOG = LogFactory.getLog(TestMRJobs.class);
+  private static final Log LOG =
+    LogFactory.getLog(TestMRJobsWithHistoryService.class);
 
   private static MiniMRYarnCluster mrCluster;
 



Mime
View raw message