hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Kennedy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1509) Open HRegionServer/HClient for extension
Date Thu, 21 Jun 2007 14:46:26 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506924

James Kennedy commented on HADOOP-1509:

+HClient.getConf doesn't have to be public though I see no harm in it.  Supposedly the client
user already has a handle to the conf object anyway though,  i'll make it protected.

+perhaps exposing HClient.getOpenServers was overzealous.  The only place where I use it in
my extension is in where I override HClient.getHRegionConnection().  The only reason this
override is necessary is because to make RPC work with added methods in my HRegionServer extension
(call it QRegionServer), i need to inject the QRegionServerInterface.  

server = (QRegionInterface) RPC.waitForProxy(
					QRegionInterface.class, QRegionInterface.versionID,
					regionServer.getInetSocketAddress(), getConf());

Incidentally that is also the only place where I use the, now protected, getConf() method.

If there was a configuration parameter that specified an HRegionServer extending interface,
and the base impl of HClient.getHRegionConnection() used that to initialize the server proxy,
then all that would become unnecessary.  What do you think of that idea? I guess a similar
pattern should exist for injecting specific HClient impls into HMaster too.

+About public HRegion and its scanner... I'm not sure how to make it accessible only to HRegionServer
subclasses without making it an inner class. I have a particular need for it where my QRegionServer
perfroms scans on its own HRegions... put perhaps there isn't a general need for that and
I could remove that from this patch. Or maybe HRegion manipulation is a likely need for HRegionServer
extensions... what do you think?

> Open HRegionServer/HClient for extension
> ----------------------------------------
>                 Key: HADOOP-1509
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1509
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Assignee: James Kennedy
>            Priority: Minor
>             Fix For: 0.14.0
>         Attachments: openForExtension-v2.patch, openForExtension.patch
> For what i'm doing I found it necessary to extend HRegionServer/HRegion/HClient for some
custom functionality.
> Following good Java practice I see that the HBase code as been programmed defensively,
keeping stuff private as much as possible.
> However, for extensibility it would be nice if the servers/client were easy to extend.
> Attached is a patch that makes several methods protected instead of private, adds getters
to fields of inner classes, and some other modifications i found were useful for some simple
extension code.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message