org.apache.hadoop.hbase.client.Admin.decommissionRegionServers()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.apache.hadoop.hbase.client.Admin.decommissionRegionServers()方法的一些代码示例,展示了Admin.decommissionRegionServers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.decommissionRegionServers()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:decommissionRegionServers

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());

相关文章

Admin类方法