[
https://issues.apache.org/jira/browse/HBASE-16010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15795329#comment-15795329
]
Appy commented on HBASE-16010:
------------------------------
Sorry for late review, was away on vacation. Please consider making following
changes in an addendum patch.
bq. Instead of draining, we should use the term decommission/recommission I
think
Would be great to use Enis's above suggestion. Instead of
drainRegionServers*/removeDrainFromRegionServers* in functions and PBs,
decommissionRegionServers*/recommissionRegionServers* would have been better.
bq. ListDrainingRegionServersRequest.newBuilder().build()
ListDrainingRegionServersRequest.getDefaultInstance()
bq. listDrainingRegionServers(null, req)
Why is it null?
bq.
{noformat}
1702 try {
1703 master.checkInitialized();
1704 List<ServerName> servers = master.listDrainingRegionServers();
1705 for (ServerName server : servers) {
1706 response.addServerName(ProtobufUtil.toServerName(server));
1707 }
1708 } catch (IOException io) {
1709 throw new ServiceException(io);
1710 }
{noformat}
only master.checkInitilized needs exception handling, move others out of the
block.
ditto for next two functions
bq. DrainRegionServersResponse.Builder response =
DrainRegionServersResponse.newBuilder();
Directly return DrainRegionServersResponse.getDefaultInstance() in the end.
ditto for RemoveDrainFromRegionServersResponse.
In testDrainRegionServers(), instead of manually maintaining
thread,executor,future, please use admin.createTableAsync() and wait on the
future.
> Put draining function through Admin API
> ---------------------------------------
>
> Key: HBASE-16010
> URL: https://issues.apache.org/jira/browse/HBASE-16010
> Project: HBase
> Issue Type: Improvement
> Reporter: Jerry He
> Assignee: Matt Warhaftig
> Priority: Minor
> Fix For: 2.0.0
>
> Attachments: HBASE-16010-v3.patch, hbase-16010-v1.patch,
> hbase-16010-v2.patch
>
>
> Currently, there is no Amdin API for draining function. Client has to
> interact directly with Zookeeper draining node to add and remove draining
> servers.
> For example, in draining_servers.rb:
> {code}
> zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config,
> "draining_servers", nil)
> parentZnode = zkw.drainingZNode
> begin
> for server in servers
> node = ZKUtil.joinZNode(parentZnode, server)
> ZKUtil.createAndFailSilent(zkw, node)
> end
> ensure
> zkw.close()
> end
> {code}
> This is not good in cases like secure clusters with protected Zookeeper nodes.
> Let's put draining function through Admin API.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)