hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Vishwakarma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13056) Refactor table.jsp code to remove repeated code and make it easier to add new checks
Date Wed, 18 Feb 2015 05:05:11 GMT

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

Vikas Vishwakarma commented on HBASE-13056:
-------------------------------------------

[~andrew.purtell@gmail.com] I tried including the null check fix for HBASE-13001 in this patch,
but this null check is missing at the top level in the lines given below and I will have to
move around quiet a few lines of embedded java code to handle this properly. It is getting
slightly confusing to handle both at the same time. Should it be ok to patch this in first
and then handle the null check separately? if not, I will add both fixes in here and submit
the patch after complete testing.

{noformat}
     String fqtn = request.getParameter("name"); 
     HTable table = (HTable) master.getConnection().getTable(fqtn)
{noformat}

Also I need some help on how to handle this:
Should I just print a message like "Table not found or Table not ready" message and then redirect
to the master page ?



> Refactor table.jsp code to remove repeated code and make it easier to add new checks
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-13056
>                 URL: https://issues.apache.org/jira/browse/HBASE-13056
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Vikas Vishwakarma
>            Assignee: Vikas Vishwakarma
>             Fix For: 2.0.0
>
>         Attachments: HBASE-13056.patch
>
>
> While trying to fix HBASE-13001, I realized that there is lot of html code repetition
in table.jsp which is making addition of new checks slightly difficult in the sense I will
have to:
> 1. Add the check at multiple places in the code
> Or 
> 2. Repeat the html code again for the new check 
> So I am proposing to re-factor table.jsp code such that the common html header/body is
loaded without any condition check and then we generate the condition specific html code 
> snapshot.jsp follows the same format as explained below:
> {noformat}
> Current implementation:
> ====================
> if( x ) {
>   title_x
>   common_html_header
>   common_html_body
>   x_specific_html_body
> } else {
>   title_y
>   common_html_header
>   common_html_body
>   y_specific_html_body
> }
> New Implementation:
> ==================
> if( x ) {
>   title_x
> } else {
>   title_y
> }
> common_html_header
> common_html_body
> if( x ) {
>   x_specific_html_body
> } else {
>   y_specific_html_body
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message