[
https://issues.apache.org/jira/browse/HBASE-19007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16204355#comment-16204355
]
stack commented on HBASE-19007:
-------------------------------
One thought is to remove CoprocessorRegionServerServices and instead just
expose Server.
The CorprocessorRegionServerServices looks like this:
{code}
public interface CoprocessorRegionServerServices extends ImmutableOnlineRegions
{
boolean isStopping();
FileSystem getFileSystem();
Set<TableName> getOnlineTables();
Connection getConnection();
ServerName getServerName();
{code}
HBASE-12260 changes Server to look like this:
{code}
// This Interface shines through MasterServices and RegionServerServices. They
subclass it.
// Be careful what you add here. Make sure it ok for CPs to have access else
add elsewhere.
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
public interface Server extends Abortable, Stoppable {
Configuration getConfiguration();
Connection getConnection();
ServerName getServerName();
ChoreService getChoreService();
ZooKeeperWatcher getZooKeeper();
}
{code}
i.e. Server is now annotated as IA.LP.
Server has getZooKeeper and getChoreService. We could let CPs have access to
these items. CPRSS has isStopping, getFileSystem, and getOnlineTables. I don't
think we should expose getFileSystem to CPs. Only the processes should be
modifying FS. isStoppping (isAborting, etc -- the read-only methods) can be
moved to Server. getOnlineTables is weird. For Quota only. Lets fix Quota and
not expose it here.
So, it looks like the HBASE-12260 could be used in place of CPRSS. On the RS
side, we could have Server for CPs and RSS for everywhere else.
Regards MasterService in HBASE-12260, here is what it looks like currently:
{code}
boolean isServerCrashProcessingEnabled();
boolean isActiveMaster();
boolean isInitialized();
boolean isInMaintenanceMode();
boolean isStopping();
boolean isSplitOrMergeEnabled(MasterSwitchType switchType);
public String getRegionServerVersion(final ServerName sn);
String getClientIdAuditPrefix();
void registerListener(final ServerListener listener);
boolean unregisterListener(final ServerListener listener);
{code}
No CP cares about isServerCrashPrcoessingEnabled. They might care about
isInitialized though doubt it as long as we ensure CP is only up at end of
initialization. isActiveMaster is not a CP concern. isMaintenanceMode neither.
isStopping would be in Server. isSplitOrMergeEnabled is something they can ask
of Admin Interface. getRegionServerVersion should be in Server as getVersion.
getClientIdAuditPrefix and the registerListener/unregister could be put into a
small Master mix-in Interface.
Proposal is that on the RS-side, rather than CPRSS we give CPs a
slightly-amended Server Interface. On Master side we hand-in a
MasterCoprocessorServices which would be a Server + ServerLIstener Interface
(and perhaps one or two other methods).
Perhaps better is we change *CoprocessorHost so they both have a getServer
method to return Server and then a getServices to return a Master/RegionServer
specific Interface of a minimal items.
> Align Services Interfaces in Master and RegionServer
> ----------------------------------------------------
>
> Key: HBASE-19007
> URL: https://issues.apache.org/jira/browse/HBASE-19007
> Project: HBase
> Issue Type: Task
> Reporter: stack
> Priority: Blocker
>
> HBASE-18183 adds a CoprocessorRegionServerService to give a view on
> RegionServiceServices that is safe to expose to Coprocessors.
> On the Master-side, MasterServices becomes an Interface for exposing to
> Coprocessors.
> We need to align the two.
> For background, see
> https://issues.apache.org/jira/browse/HBASE-12260?focusedCommentId=16203820&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16203820
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)