[
https://issues.apache.org/jira/browse/HBASE-20109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16381473#comment-16381473
]
Reid Chan edited comment on HBASE-20109 at 3/1/18 3:50 AM:
-----------------------------------------------------------
{code}
default ServerName getMaster() throws IOException {
return getClusterMetrics(EnumSet.of(Option.MASTER)).getMasterName();
}
{code}
Ya, it's lightweight, {{ServerName}} also contains host and port.
But i doubt that the option feature is in branch-1?
was (Author: reidchan):
{code}
default ServerName getMaster() throws IOException {
return getClusterMetrics(EnumSet.of(Option.MASTER)).getMasterName();
}
{code}
Ya, it's lightweight, {ServerName} also contains host and port.
But i doubt that the option feature is in branch-1?
> Add Admin#getMasterLocation API for lightweight discovery of the active
> master location
> ---------------------------------------------------------------------------------------
>
> Key: HBASE-20109
> URL: https://issues.apache.org/jira/browse/HBASE-20109
> Project: HBase
> Issue Type: Improvement
> Components: Client
> Affects Versions: 1.4.2
> Reporter: Andrew Purtell
> Assignee: Andrew Purtell
> Priority: Minor
> Fix For: 2.0.0, 1.5.0
>
>
> Right now the only public API available to the client to learn the server
> name of the active master is Admin#getClusterStatus#getMaster, returning
> ServerName. On a cluster of any size getClusterStatus is expensive,
> especially if used only to retrieve the active master name.
> Let's add a simple API
> {code}
> ServerName Admin#getMasterLocation()
> {code}
> for lightweight discovery of the active master location. This makes sense
> because, weirdly, Admin already has a method getMasterInfoPort(), returning
> int.
> Internally the client has a notion of the active master because there is a
> connection open to it, or one that can be reopened, or if for some reason
> it's not easy to make a ServerName for that state, the ServerName can be
> deserialized out of the znode tracking the active master location.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)