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

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

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

Admin.assign介绍

暂无

代码示例

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

/**
 * In 0.90, this forces an HRI offline by setting the RegionTransitionData
 * in ZK to have HBCK_CODE_NAME as the server.  This is a special case in
 * the AssignmentManager that attempts an assign call by the master.
 *
 * This doesn't seem to work properly in the updated version of 0.92+'s hbck
 * so we use assign to force the region into transition.  This has the
 * side-effect of requiring a RegionInfo that considers regionId (timestamp)
 * in comparators that is addressed by HBASE-5563.
 */
private static void forceOfflineInZK(Admin admin, final RegionInfo region)
throws ZooKeeperConnectionException, KeeperException, IOException, InterruptedException {
 admin.assign(region.getRegionName());
}

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

@Test
public void testBalancerWithoutFavoredNodes() throws Exception {
 TableName tableName = TableName.valueOf("testBalancerWithoutFavoredNodes");
 HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY));
 admin.createTable(desc, Bytes.toBytes("aaa"), Bytes.toBytes("zzz"), REGION_NUM);
 TEST_UTIL.waitTableAvailable(tableName);
 final RegionInfo region = admin.getTableRegions(tableName).get(0);
 LOG.info("Region thats supposed to be in transition: " + region);
 FavoredNodesManager fnm = master.getFavoredNodesManager();
 List<ServerName> currentFN = fnm.getFavoredNodes(region);
 assertNotNull(currentFN);
 fnm.deleteFavoredNodesForRegions(Lists.newArrayList(region));
 RegionStates regionStates = master.getAssignmentManager().getRegionStates();
 admin.setBalancerRunning(true, true);
 // Balancer should unassign the region
 assertTrue("Balancer did not run", admin.balancer());
 TEST_UTIL.waitUntilNoRegionsInTransition();
 admin.assign(region.getEncodedNameAsBytes());
 TEST_UTIL.waitUntilNoRegionsInTransition(60000);
 currentFN = fnm.getFavoredNodes(region);
 assertNotNull(currentFN);
 assertEquals("Expected number of FN not present",
  FavoredNodeAssignmentHelper.FAVORED_NODES_NUM, currentFN.size());
 assertTrue("Balancer did not run", admin.balancer());
 TEST_UTIL.waitUntilNoRegionsInTransition(60000);
 checkFavoredNodeAssignments(tableName, fnm, regionStates);
}

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

admin.assign(regionToMove.getRegionName());

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

fnm.updateFavoredNodes(regionFNMap);
LOG.info("Assigning region: " + regionInfo.getEncodedName());
admin.assign(regionInfo.getEncodedNameAsBytes());

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

admin.assign(ri.getRegionName());
} catch (Throwable dnrioe) {

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

fnm.updateFavoredNodes(regionFNMap);
LOG.info("Assigning region: " + regionInfo.getEncodedName());
admin.assign(regionInfo.getEncodedNameAsBytes());

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

TEST_UTIL.getAdmin().assign(hri.getRegionName());
startTime = EnvironmentEdgeManager.currentTime();
while (true) {

代码示例来源:origin: larsgeorge/hbase-book

admin.assign(offline.getRegionName()); // co ClusterOperationExample-09-Reassign Reassign the offlined region.
revs = 0;
do {

代码示例来源:origin: larsgeorge/hbase-book

admin.assign(location.getRegionInfo().getRegionName()); // co MissingRegionExample-9-Open Open the region, which will make the blocked get() in the thread wake up and print its waiting time.

代码示例来源:origin: harbby/presto-connectors

/**
 * In 0.90, this forces an HRI offline by setting the RegionTransitionData
 * in ZK to have HBCK_CODE_NAME as the server.  This is a special case in
 * the AssignmentManager that attempts an assign call by the master.
 *
 * @see org.apache.hadoop.hbase.master.AssignementManager#handleHBCK
 *
 * This doesn't seem to work properly in the updated version of 0.92+'s hbck
 * so we use assign to force the region into transition.  This has the
 * side-effect of requiring a HRegionInfo that considers regionId (timestamp)
 * in comparators that is addressed by HBASE-5563.
 */
private static void forceOfflineInZK(Admin admin, final HRegionInfo region)
throws ZooKeeperConnectionException, KeeperException, IOException, InterruptedException {
 admin.assign(region.getRegionName());
}

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

@Test
public void testBalancerWithoutFavoredNodes() throws Exception {
 TableName tableName = TableName.valueOf("testBalancerWithoutFavoredNodes");
 HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY));
 admin.createTable(desc, Bytes.toBytes("aaa"), Bytes.toBytes("zzz"), REGION_NUM);
 TEST_UTIL.waitTableAvailable(tableName);
 final RegionInfo region = admin.getTableRegions(tableName).get(0);
 LOG.info("Region thats supposed to be in transition: " + region);
 FavoredNodesManager fnm = master.getFavoredNodesManager();
 List<ServerName> currentFN = fnm.getFavoredNodes(region);
 assertNotNull(currentFN);
 fnm.deleteFavoredNodesForRegions(Lists.newArrayList(region));
 RegionStates regionStates = master.getAssignmentManager().getRegionStates();
 admin.setBalancerRunning(true, true);
 // Balancer should unassign the region
 assertTrue("Balancer did not run", admin.balancer());
 TEST_UTIL.waitUntilNoRegionsInTransition();
 admin.assign(region.getEncodedNameAsBytes());
 TEST_UTIL.waitUntilNoRegionsInTransition(60000);
 currentFN = fnm.getFavoredNodes(region);
 assertNotNull(currentFN);
 assertEquals("Expected number of FN not present",
  FavoredNodeAssignmentHelper.FAVORED_NODES_NUM, currentFN.size());
 assertTrue("Balancer did not run", admin.balancer());
 TEST_UTIL.waitUntilNoRegionsInTransition(60000);
 checkFavoredNodeAssignments(tableName, fnm, regionStates);
}

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

admin.assign(regionToMove.getRegionName());

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

fnm.updateFavoredNodes(regionFNMap);
LOG.info("Assigning region: " + regionInfo.getEncodedName());
admin.assign(regionInfo.getEncodedNameAsBytes());

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

admin.assign(ri.getRegionName());
} catch (Throwable dnrioe) {

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

assertEquals(1, regions.size());
for (HRegionInfo region : regions) {
 TEST_UTIL.getAdmin().assign(region.getEncodedNameAsBytes());

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

fnm.updateFavoredNodes(regionFNMap);
LOG.info("Assigning region: " + regionInfo.getEncodedName());
admin.assign(regionInfo.getEncodedNameAsBytes());

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

TEST_UTIL.getAdmin().assign(hri.getRegionName());
startTime = EnvironmentEdgeManager.currentTime();
while (true) {

相关文章

Admin类方法