Issue Details (XML | Word | Printable)

Key: HADOOP-3866
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: craig weisenfluh
Reporter: craig weisenfluh
Votes: 0
Watchers: 11
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Improve Hadoop Jobtracker Admin

Created: 30/Jul/08 06:53 PM   Updated: 20/Nov/08 11:38 PM
Component/s: scripts
Affects Version/s: 0.16.4
Fix Version/s: 0.19.0

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works admin-1.patch 2008-07-30 09:12 PM craig weisenfluh 17 kB
Text File Licensed for inclusion in ASF works hadoop-3866-v2.patch 2008-08-26 09:40 PM craig weisenfluh 14 kB
Text File Licensed for inclusion in ASF works hadoop-3866-v3.patch 2008-08-27 04:38 PM Tom White 16 kB
Text File Licensed for inclusion in ASF works hadoop-3866.patch 2008-07-31 02:05 PM Tom White 14 kB
Environment: javascript functionality will target firefox
Issue Links:
Reference
 

Hadoop Flags: Reviewed
Resolution Date: 03/Sep/08 09:24 PM

Sub-Tasks  All   Open   

 Description  « Hide
A number of enhancements to the jobtracker jsp that allow for searching, scheduling, and navigating a large number of jobs. These enhancements are to be added as subtasks, to follow.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Hadoop QA added a comment - 31/Jul/08 12:12 AM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12387230/admin-1.patch
against trunk revision 681243.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

-1 patch. The patch command could not apply the patch.

Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2988/console

This message is automatically generated.


Owen O'Malley added a comment - 31/Jul/08 06:52 AM
New functionality needs to go into trunk, rather than the 0.16 branch, which along with the 0.17 and 0.18 branches are frozen for new features.

Tom White added a comment - 31/Jul/08 10:18 AM
Craig, this looks like a good addition. A few comments:

1. By default you should not be able kill jobs from the web UI (see https://issues.apache.org/jira/browse/HADOOP-1484). So you should only show the button to kill jobs if webinterface.private.actions is set to true. (Changing priorities is always allowed.) Equally importantly you should only respond to a POST request to kill jobs if the property is set to true.
2. Change "Delete Selected" to "Kill Selected Jobs" for consistency with with the command line interface and the rest of UI.
3. Rename hadoop.js to jobtracker.js to encourage modularity of javascript files.
4. Would it be better to put the filter box with the content that it filters? I.e. in a section that includes running, completed and failed jobs.
5. Can we left-justify the tables and the header for consistency with the HDFS interface?
6. Should we use a library like prototype (http://www.prototypejs.org/) to make the javascript work better across browsers?

Finally, I notice that the JSPs have a lot of embedded Java (this is true with the current code: this patch is just following the current style), which makes them hard to test and hard to extend or reuse. Is there a better design we should adopt so that we can aim to improve our code over time? Thoughts?


Steve Loughran added a comment - 31/Jul/08 11:13 AM
>Finally, I notice that the JSPs have a lot of embedded Java (this is true with the current code: this patch is just following the current style), which makes them hard to test and hard to extend or reuse. Is there a better design we should adopt so that we can aim to improve our code over time? Thoughts?

I've noticed that too. It's not ideal, and the use of JSP forces hadoop to have the jasper runtimes.

Some options

1. Move to JSP tags and define custom tags for lots of the reporting.
+Moves some of the work into Java classes
+lets you do some layout/graphics logic in the JSP pages
-makes for an even more complex build/test process
-lots of engineering work which is hard to justify unless the tags are reused
-may move some html output into the Java source

2. Move all the html generation to the java source.
+ could use something like xmlenc to make it cleaner
+ eliminates jspc and the jasper jars

  • xmlenc isn't namespace aware; cannot do XHTML, would need an updated rewrite
  • doing all the presentation in jsp code is pretty ugly too
  • would need a new servlet for every page

Steve Loughran added a comment - 31/Jul/08 01:37 PM
Here's another option, nice and simple

3. Move the Java code from JSP pages into associated Java source.

There's no reason why you can't have Java source that takes as arguments the request, response and JSPWriter and does the work inside its own code. No need for JSP tags, almost no mixing of Java and JSP content.

Having looked at some of the JSP pages, I'm going to suggest some JSP cleanups as separate issues.


Tom White added a comment - 31/Jul/08 02:05 PM
Patch for trunk that also addresses points 1-5 above.

Tom White added a comment - 31/Jul/08 02:14 PM
> 3. Move the Java code from JSP pages into associated Java source.

This is the technique used on the HDFS pages with the org.apache.hadoop.hdfs.server.namenode.JspHelper class. Perhaps we should do the same with the MapReduce pages. The trick is keeping the markup and code separate, as far as is possible.


Matei Zaharia added a comment - 31/Jul/08 11:11 PM
If you want to separate presentation from code without needing a JSP runtime, you might want to take a look at Apache Velocity (http://velocity.apache.org/engine/devel/getting-started.html), which is a lighter-weight template language that nonetheless lets you defined named objects in your Java code and access them from Velocity templates using bean properties. I've used it for showing some tables before, it's not too bad. It would probably require only a bit more extra work than moving the Java logic into Java.

Bill de hOra added a comment - 03/Aug/08 09:45 AM

3. Move the Java code from JSP pages into associated Java source.

isn't the downside that the web pages can't be changed without going at or around the source? I had a look at JspHelper and don't see that's it's much better than the current JSP files (no class attributes, hardcoded styes). I think I'd suggest a barebones templating language like StringTemplate (BSD) over Java helpers - or is there a suitable ASF lib?


Owen O'Malley added a comment - 18/Aug/08 09:08 PM
This is pretty cool. I noticed however that if I click on change when no jobs are selected you get an Internal Server Error. Can we get that fixed?

craig weisenfluh added a comment - 18/Aug/08 11:16 PM
hi owen - i am having trouble reproducing this. a few questions: what browser are you using? are you seeing this error in the browser, or in the logs for the jobtracker? finally, what operation are you trying to do (priority change or kill, or both). thanks!

Owen O'Malley added a comment - 18/Aug/08 11:40 PM
Ah, sorry about that. I'm using Mac OS & Firefox 3.0.1.

I had no jobs selected and changed the priority and pressed "change". Clicked "ok" and then get:

HTTP ERROR: 500

Internal Server Error

RequestURI=/jobtracker.jsp

Powered by Jetty://

back in the browser. More importantly, here is the exception stack from the job tracker log:

2008-08-18 16:30:27,576 WARN /: /jobtracker.jsp: 
java.lang.NullPointerException
        at org.apache.hadoop.mapred.jobtracker_jsp.processButtons(jobtracker_jsp
.java:41)
        at org.apache.hadoop.mapred.jobtracker_jsp._jspService(jobtracker_jsp.ja
va:196)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427
)
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
onHandler.java:475)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
67)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
        at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
Context.java:635)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
        at org.mortbay.http.HttpServer.service(HttpServer.java:954)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
244)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

craig weisenfluh added a comment - 26/Aug/08 09:40 PM
fix for null pointer exception in browser when no checkbox is specified and priority is changed.

Hadoop QA added a comment - 27/Aug/08 10:26 AM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12388955/hadoop-3866-v2.patch
against trunk revision 689380.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

-1 release audit. The applied patch generated 273 release audit warnings (more than the trunk's current 271 warnings).

+1 core tests. The patch passed core unit tests.

-1 contrib tests. The patch failed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3118/testReport/
Release audit warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3118/artifact/trunk/current/releaseAuditDiffWarnings.txt
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3118/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3118/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3118/console

This message is automatically generated.


Tom White added a comment - 27/Aug/08 04:38 PM
Added license headers to hadoop.css and jobtracker.js.

There are no unit tests for this change since it is a change in the web UI (which doesn't have any automated testing at the moment). The contrib test failure is unrelated to this change.


Hadoop QA added a comment - 27/Aug/08 10:44 PM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12389014/hadoop-3866-v3.patch
against trunk revision 689602.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

-1 contrib tests. The patch failed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3126/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3126/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3126/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3126/console

This message is automatically generated.


Steve Loughran added a comment - 28/Aug/08 01:06 PM
> There are no unit tests for this change since it is a change in the web UI (which doesn't have any automated testing at the moment). The contrib test failure is unrelated to this change.

You mean, because nobody has written any tests for the UI, you don't need to add any either ? Just checking


Owen O'Malley added a comment - 03/Sep/08 09:24 PM
I just committed this. Thanks, Craig!

Hudson added a comment - 06/Sep/08 01:23 PM