[ 
https://issues.apache.org/jira/browse/HBASE-15799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Warhaftig updated HBASE-15799:
-----------------------------------
    Attachment: hbase-15799-v1.patch

Attached patch 'hbase-15799-v1.patch' uses presence of period at end of 
close_region command's region parameter to decide if region value is encoded 
and choose proper HBaseAdmin close region call.  
HBaseAdmin.closeRegionWithEncodedRegionName() requires servername so 
close_region command's help message has been updated to not list incorrect 
syntax of {{close_region 'ENCODED_REGIONNAME'}}.

> Two Shell 'close_region' Example Syntaxes Don't Work
> ----------------------------------------------------
>
>                 Key: HBASE-15799
>                 URL: https://issues.apache.org/jira/browse/HBASE-15799
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 2.0.0
>            Reporter: Matt Warhaftig
>            Assignee: Matt Warhaftig
>            Priority: Minor
>         Attachments: hbase-15799-v1.patch
>
>
> The close_region shell command's help message lists the following usage 
> syntaxes:
> {noformat}
> hbase> close_region 'REGIONNAME'
> hbase> close_region 'REGIONNAME', 'SERVER_NAME'
> hbase> close_region 'ENCODED_REGIONNAME'
> hbase> close_region 'ENCODED_REGIONNAME', 'SERVER_NAME'
> {noformat}
> admin.rb's current code (with close_region method being the entry point) is:
> {code}
> def close_region(region_name, server)
>   if (server == nil || !closeEncodedRegion?(region_name, server))
>     @admin.closeRegion(region_name, server)
>   end
> end
> def closeEncodedRegion?(region_name, server)
>    @admin.closeRegionWithEncodedRegionName(region_name, server)
> end
> {code}
> The {{close_region 'ENCODED_REGIONNAME'}} syntax currently will not work 
> because when server = nil the {{closeEncodedRegion}} method call is skipped.
> The {{close_region 'REGIONNAME', 'SERVER_NAME'}} syntax currently will not 
> work because {{@admin.closeRegionWithEncodedRegionName}} throws an 
> NotServingRegionException (for the non-encoded region_name) that is uncaught 
> in and prevents execution from returning to {{close_region}} and the correct 
> call of {{HBaseAdmin.closeRegion}}. 



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

Reply via email to