[ 
https://issues.apache.org/jira/browse/HDFS-5333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13790685#comment-13790685
 ] 

Haohui Mai commented on HDFS-5333:
----------------------------------

Thanks [~andrew.wang] for the pointer.

One task of this jira is to modernize the UIs, however, the most important task 
I want to achieve in this jira is to move from server-side JSP pages towards 
client-based, AJAX-styled HTML 5 web pages.

The reasons of phasing out JSP pages are the following:

* Hard to maintain. JSP pages combine the presentation and the logic. It's not 
easy to maintain them, and they are error-prone. (e.g., HDFS-5317 fixes the 
link errors in the web UIs).
* Duplicated logic. The JSP pages need to reinvent the wheels that we have in 
the JMX servlets. Maintaining both of them and making them consistent is a 
non-trivial task.
* Lack of client-side caching. The server generates the JSP pages dynamically, 
much of which cannot be cached at the client sides, increasing the loads of the 
server.

I propose that the UIs makes AJAX requests to collect information from JMX, and 
then use JavaScript template engines to render the page entirely in the client 
side. There are several benefits of this architecture:

* Empirical experiences show that it is much easier to maintain a client-side 
template. (see 
http://engineering.linkedin.com/frontend/leaving-jsps-dust-moving-linkedin-dustjs-client-side-templates)
* Our lives are easier since we no longer need to maintain both JMX and JSP 
pages, and making them consistent.
* The client can now cache the templates and the JavaScript to generate the 
pages, reducing the server loads.

My first implementation follows the linkedin's approach. I used dust.js 
(https://github.com/linkedin/dustjs), jQuery (jquery.com), and 
bootstrap(bootstrap.com). They are free from licensing issues. Furthermore, 
both jQuery and bootstrap are widely available from CDNs, therefore there is no 
need to include them in the patches, easing the reviews of the patches.

> Improvement of current HDFS Web UI
> ----------------------------------
>
>                 Key: HDFS-5333
>                 URL: https://issues.apache.org/jira/browse/HDFS-5333
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>            Reporter: Jing Zhao
>            Assignee: Haohui Mai
>
> This is an umbrella jira for improving the current JSP-based HDFS Web UI. 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to