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

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

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

Admin.listDecommissionedRegionServers介绍

[英]List region servers marked as decommissioned, which can not be assigned regions.
[中]列出标记为停用的区域服务器,这些服务器不能分配区域。

代码示例

代码示例来源: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

@Test
public void testDecommissionRegionServers() throws Exception {
 List<ServerName> decommissionedRegionServers = admin.listDecommissionedRegionServers();
 assertTrue(decommissionedRegionServers.isEmpty());
 assertEquals(2, admin.listDecommissionedRegionServers().size());
  admin.recommissionRegionServer(server, encodedRegionNames);
 assertTrue(admin.listDecommissionedRegionServers().isEmpty());

代码示例来源:origin: apache/hbase

serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
assertEquals(0, admin.listDecommissionedRegionServers().size());
admin.createTable(desc);

代码示例来源:origin: apache/hbase

deleteGroups();
for(ServerName sn : admin.listDecommissionedRegionServers()){
 admin.recommissionRegionServer(sn, null);
assertTrue(admin.listDecommissionedRegionServers().isEmpty());

代码示例来源:origin: apache/hbase

assertEquals(1, admin.listDecommissionedRegionServers().size());

代码示例来源:origin: org.apache.hbase/hbase-server

@Test
public void testDecommissionRegionServers() throws Exception {
 List<ServerName> decommissionedRegionServers = admin.listDecommissionedRegionServers();
 assertTrue(decommissionedRegionServers.isEmpty());
 assertEquals(2, admin.listDecommissionedRegionServers().size());
  admin.recommissionRegionServer(server, encodedRegionNames);
 assertTrue(admin.listDecommissionedRegionServers().isEmpty());

代码示例来源: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

serversToDecommission.add(targetServer);
admin.decommissionRegionServers(serversToDecommission, true);
assertEquals(1, admin.listDecommissionedRegionServers().size());
assertEquals(0, admin.listDecommissionedRegionServers().size());
admin.createTable(desc);

代码示例来源:origin: org.apache.hbase/hbase-rsgroup

deleteGroups();
for(ServerName sn : admin.listDecommissionedRegionServers()){
 admin.recommissionRegionServer(sn, null);
assertTrue(admin.listDecommissionedRegionServers().isEmpty());

代码示例来源:origin: org.apache.hbase/hbase-rsgroup

assertEquals(1, admin.listDecommissionedRegionServers().size());

相关文章

Admin类方法