本文整理了Java中org.apache.hadoop.hbase.client.Admin.decommissionRegionServers()
方法的一些代码示例,展示了Admin.decommissionRegionServers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.decommissionRegionServers()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:decommissionRegionServers
[英]Mark region server(s) as decommissioned to prevent additional regions from getting assigned to them. Optionally unload the regions on the servers. If there are multiple servers to be decommissioned, decommissioning them at the same time can prevent wasteful region movements. Region unloading is asynchronous.
[中]将区域服务器标记为已停用,以防止将其他区域分配给它们。(可选)卸载服务器上的区域。如果有多台服务器要停用,则同时停用它们可以防止浪费的区域移动。区域卸载是异步的。
代码示例来源:origin: apache/hbase
admin.decommissionRegionServers(new ArrayList<ServerName>(serversToDecommssion.keySet()), true);
assertEquals(2, admin.listDecommissionedRegionServers().size());
代码示例来源:origin: apache/hbase
@Test
public void testAdminDrainAllowedOnSecureZK() throws Exception {
if (!secureZKAvailable) {
return;
}
List<ServerName> decommissionedServers = new ArrayList<>(1);
decommissionedServers.add(ServerName.parseServerName("ZZZ,123,123"));
// If unable to connect to secure ZK cluster then this operation would fail.
TEST_UTIL.getAdmin().decommissionRegionServers(decommissionedServers, false);
decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
assertEquals(1, decommissionedServers.size());
assertEquals(ServerName.parseServerName("ZZZ,123,123"), decommissionedServers.get(0));
TEST_UTIL.getAdmin().recommissionRegionServer(decommissionedServers.get(0), null);
decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
assertEquals(0, decommissionedServers.size());
}
代码示例来源:origin: apache/hbase
assertTrue(master.getServerManager().getOnlineServers().containsKey(targetServer));
serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
代码示例来源:origin: apache/hbase
serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
代码示例来源:origin: org.apache.hbase/hbase-server
admin.decommissionRegionServers(new ArrayList<ServerName>(serversToDecommssion.keySet()), true);
assertEquals(2, admin.listDecommissionedRegionServers().size());
代码示例来源:origin: org.apache.hbase/hbase-server
@Test
public void testAdminDrainAllowedOnSecureZK() throws Exception {
if (!secureZKAvailable) {
return;
}
List<ServerName> decommissionedServers = new ArrayList<>(1);
decommissionedServers.add(ServerName.parseServerName("ZZZ,123,123"));
// If unable to connect to secure ZK cluster then this operation would fail.
TEST_UTIL.getAdmin().decommissionRegionServers(decommissionedServers, false);
decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
assertEquals(1, decommissionedServers.size());
assertEquals(ServerName.parseServerName("ZZZ,123,123"), decommissionedServers.get(0));
TEST_UTIL.getAdmin().recommissionRegionServer(decommissionedServers.get(0), null);
decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
assertEquals(0, decommissionedServers.size());
}
代码示例来源:origin: org.apache.hbase/hbase-rsgroup
assertTrue(master.getServerManager().getOnlineServers().containsKey(targetServer));
serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
代码示例来源:origin: org.apache.hbase/hbase-rsgroup
serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
内容来源于网络,如有侵权,请联系作者删除!