[
https://issues.apache.org/jira/browse/HBASE-9992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13827938#comment-13827938
]
Nick Dimiduk commented on HBASE-9992:
-------------------------------------
I take it all back. I thought there was a way to ensure argument parsing
happens in the correct order, but to do so requires not passing {{conf}} via
constructor. Tool + Configured API is pretty bon-headed because it forces
clients to not follow the RAII pattern.
Yes, "less hacky" would be to directly extend {{Tool}}, only make use of an
empty constructor, and initializing the class from the {{run}} method.
Presumably that means callers from code are forced to invoke an external
{{initialize}} on their own. That is the pattern {{Tool}} says you "should" do.
Do as you will.
> [hbck] Refactor so that arbitrary -D cmdline options are included
> ------------------------------------------------------------------
>
> Key: HBASE-9992
> URL: https://issues.apache.org/jira/browse/HBASE-9992
> Project: HBase
> Issue Type: Bug
> Components: hbck
> Affects Versions: 0.96.0, 0.94.13
> Reporter: Jonathan Hsieh
> Assignee: Jonathan Hsieh
> Fix For: 0.98.0, 0.96.1, 0.94.14
>
> Attachments: hbase-9992.patch
>
>
> A review of HBASE-9831 pointed out the fact that -D options aren't being
> passed into the configuration object used by hbck. This means overriding -D
> options will not work unless special hooks are for specific options. A first
> attempt to fix this was in HBASE-9831 but it affected many other files.
> The right approach would be to create a new HbckTool class that had the
> configured interface and change to existing HBaseFsck main to instantiate
> that to have it parse args, and then create the HBaseFsck object inside run.
--
This message was sent by Atlassian JIRA
(v6.1#6144)