Issue Details (XML | Word | Printable)

Key: HADOOP-3824
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Tsz Wo (Nicholas), SZE
Reporter: Tsz Wo (Nicholas), SZE
Votes: 0
Watchers: 2
Operations

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

Refactor org.apache.hadoop.mapred.StatusHttpServer

Created: 24/Jul/08 06:00 PM   Updated: 08/Jul/09 04:52 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.19.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 3824_20080724-v2.patch 2008-07-25 04:37 AM stack 23 kB
Text File Licensed for inclusion in ASF works 3824_20080724.patch 2008-07-24 09:58 PM Tsz Wo (Nicholas), SZE 23 kB
Text File Licensed for inclusion in ASF works 3824_20080725.patch 2008-07-25 07:02 PM Tsz Wo (Nicholas), SZE 23 kB
Text File Licensed for inclusion in ASF works 3824_20080725b.patch 2008-07-25 08:32 PM Tsz Wo (Nicholas), SZE 23 kB
Text File Licensed for inclusion in ASF works 3824_20080912_0.18.patch 2008-09-12 06:28 PM Tsz Wo (Nicholas), SZE 24 kB
Issue Links:
Blocker
 

Hadoop Flags: Reviewed
Resolution Date: 29/Jul/08 12:12 AM


 Description  « Hide
StatusHttpServer is defined in the mapred package but it is used by hdfs classes DataNode, FSNamesystem, SecondaryNameNode.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Tsz Wo (Nicholas), SZE added a comment - 24/Jul/08 06:35 PM
How about we create a package org.apache.hadoop.http in core and then split StatusHttpServer to two classes, StatusHttpServer and HttpServer, where HttpServer is an abstract base class for all hadoop http server?

stack added a comment - 24/Jul/08 08:18 PM
Can HADOOP-2024 be addressed as part of this refactoring?

Tsz Wo (Nicholas), SZE added a comment - 24/Jul/08 09:58 PM
3824_20080724.patch:
  • created org.apache.hadoop.http.HttpServer
  • changed fields from "private" to "protected final" whenever it is possible
  • changed getWebAppsPath() "private static" to "protected"
  • removed makeRuntimeException(...) by using java 6 constructor

Tsz Wo (Nicholas), SZE added a comment - 24/Jul/08 10:11 PM
> Can HADOOP-2024 be addressed as part of this refactoring?

I changed the getWebAppsPath() header as your patch in HADOOP-2024. I also changed "StatusHttpServer.class.getClassLoader()..." to "getClass().getClassLoader()...".


stack added a comment - 25/Jul/08 04:37 AM
Would you consider using this version of your patch?

Only change is to the HttpServer constructor calling out to a new method named addWebapps. Its in this method that we add webapps and servlets rather than up in the constructor. Makes it so a subclass can influence whats loaded (not load some or load with different names, etc.).

Use case is something like hbase. Currently we have a duplicate of the old StatusHttpServer. We call it InfoServer down in hbase-land. Hbase has webapps like those in hadoop-core only they want just some of the webapps+servlets that hadoop-core used put up in InfoServer. We made the duplicate because we couldn't subclass old StatusHttpServer (HADOOP-2024 was attempt at getting in a patch that would make it subclassable).

Thanks for your consideration. THanks.


Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 05:44 PM
Sure, your change looks good.

Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 07:02 PM
Found a NPE in addWebapps(...) since webAppContext is null when adding servlets.

3824_20080725.patch: fix the NPE problem.


stack added a comment - 25/Jul/08 08:18 PM
+1 on patch. It looks good. Downloaded it and tried it. UIs came up fine. Does the 'stacks' link work for you? I was typing in http://XX.XX.XXX.XX:50070/stacks. /logLevel worked fine.

Not important nitpicks:

+ Says '+ * A mepred http server. ' on the class comment for StatusHttpServer.
+ Maybe make this protected so subclasses have access: + static class StackServlet extends HttpServlet {


Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 08:32 PM
3824_20080725b.patch: fixed the following problems

> + Says '+ * A mepred http server. ' on the class comment for StatusHttpServer.
oops, there is a typo

> + Maybe make this protected so subclasses have access: + static class StackServlet extends HttpServlet {
It turns out that we need to make StackServlet public. Otherwise, jetty cannot accesses it. That's why StackServlet was not working before. For the same reason, keeping StatusHttpServer and TaskGraphServlet public.


Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 08:53 PM
Checked the web pages manually. Everything seems working fine.

Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 11:13 PM
Passed tests locally, try hudson.

Hadoop QA added a comment - 26/Jul/08 12:59 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12386921/3824_20080725b.patch
against trunk revision 679879.

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

+1 tests included. The patch appears to include 3 new or modified tests.

+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 passed contrib unit tests.

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

This message is automatically generated.


Chris Douglas added a comment - 29/Jul/08 12:12 AM
I just committed this. Thanks, Nicholas

Hudson added a comment - 22/Aug/08 12:34 PM

Tsz Wo (Nicholas), SZE added a comment - 12/Sep/08 06:28 PM
3824_20080912_0.18.patch: for 0.18

Tsz Wo (Nicholas), SZE added a comment - 12/Sep/08 06:28 PM
     [exec] +1 overall.  

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

     [exec]     +1 tests included.  The patch appears to include 3 new or modified tests.

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

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

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

Tsz Wo (Nicholas), SZE added a comment - 12/Sep/08 08:02 PM
The 0.18 patch passed all tests locally. Feel free to use it. It won't be committed to svn.