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

Sean Busbey commented on HBASE-21247:
-------------------------------------

Catching a {{Throwable}} is v dangerous and IMHO not justified for a code path 
that is essentially just handling config fallback. Also why do another lookup 
on WAL_PROVIDER instead of just passing in DEFAULT_WAL_PROVIDER?

With the shift to taking a {{Class<? extends WALProvider>}} for the default 
then the call in {{getMetaProvider}} can just look like this:

{code}
provider = createProvider(getProviderClass(META_WAL_PROVIDER, 
this.provider.class));
{code}

This makes it very clear that should META_WAL_PROVIDER be undefined we'll use 
the same class as the non-meta wal provider. It also coincidentally avoids 
doing repeated look ups on the WAL_PROVIDER config.

We can remove the {{DEFAULT_WAL_PROVIDER}} constant entirely and update the 
WALFactory constructor that creates {{this.provider}} to use 
{{Providers.defaultProvider.clazz}} directly.

Much nicer, no?

> Custom WAL Provider cannot be specified by configuration whose value is 
> outside the enums in Providers
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-21247
>                 URL: https://issues.apache.org/jira/browse/HBASE-21247
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: 21247.v1.txt, 21247.v2.txt, 21247.v3.txt, 21247.v4.tst, 
> 21247.v4.txt, 21247.v5.txt, 21247.v6.txt, 21247.v7.txt, 21247.v8.txt, 
> 21247.v9.txt
>
>
> Currently all the WAL Providers acceptable to hbase are specified in 
> Providers enum of WALFactory.
> This restricts the ability for additional WAL Providers to be supplied - by 
> class name.
> This issue fixes the bug by allowing the specification of new WAL Provider 
> class name using the config "hbase.wal.provider".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to