当前位置: 首页>>代码示例>>Java>>正文


Java HBaseAdmin.execProcedure方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.HBaseAdmin.execProcedure方法的典型用法代码示例。如果您正苦于以下问题:Java HBaseAdmin.execProcedure方法的具体用法?Java HBaseAdmin.execProcedure怎么用?Java HBaseAdmin.execProcedure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.client.HBaseAdmin的用法示例。


在下文中一共展示了HBaseAdmin.execProcedure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSimpleProcedureManager

import org.apache.hadoop.hbase.client.HBaseAdmin; //导入方法依赖的package包/类
@Test
public void testSimpleProcedureManager() throws IOException {
  HBaseAdmin admin = util.getHBaseAdmin();

  admin.execProcedure(SimpleMasterProcedureManager.SIMPLE_SIGNATURE,
      "mytest", new HashMap<String, String>());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:8,代码来源:TestProcedureManager.java

示例2: testFlushTableSnapshotWithProcedure

import org.apache.hadoop.hbase.client.HBaseAdmin; //导入方法依赖的package包/类
/**
 * Test simple flush snapshotting a table that is online
 * @throws Exception
 */
@Test (timeout=300000)
public void testFlushTableSnapshotWithProcedure() throws Exception {
  HBaseAdmin admin = UTIL.getHBaseAdmin();
  // make sure we don't fail on listing snapshots
  SnapshotTestingUtils.assertNoSnapshots(admin);

  // put some stuff in the table
  HTable table = new HTable(UTIL.getConfiguration(), TABLE_NAME);
  SnapshotTestingUtils.loadData(UTIL, table, DEFAULT_NUM_ROWS, TEST_FAM);

  // get the name of all the regionservers hosting the snapshotted table
  Set<String> snapshotServers = new HashSet<String>();
  List<RegionServerThread> servers = UTIL.getMiniHBaseCluster().getLiveRegionServerThreads();
  for (RegionServerThread server : servers) {
    if (server.getRegionServer().getOnlineRegions(TABLE_NAME).size() > 0) {
      snapshotServers.add(server.getRegionServer().getServerName().toString());
    }
  }

  LOG.debug("FS state before snapshot:");
  FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
      FSUtils.getRootDir(UTIL.getConfiguration()), LOG);

  // take a snapshot of the enabled table
  String snapshotString = "offlineTableSnapshot";
  byte[] snapshot = Bytes.toBytes(snapshotString);
  Map<String, String> props = new HashMap<String, String>();
  props.put("table", STRING_TABLE_NAME);
  admin.execProcedure(SnapshotManager.ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION,
      snapshotString, props);


  LOG.debug("Snapshot completed.");

  // make sure we have the snapshot
  List<SnapshotDescription> snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
    snapshot, TABLE_NAME);

  // make sure its a valid snapshot
  FileSystem fs = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
  Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
  LOG.debug("FS state after snapshot:");
  FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
      FSUtils.getRootDir(UTIL.getConfiguration()), LOG);

  SnapshotTestingUtils.confirmSnapshotValid(snapshots.get(0), TABLE_NAME, TEST_FAM, rootDir,
      admin, fs, false, new Path(rootDir, HConstants.HREGION_LOGDIR_NAME), snapshotServers);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:53,代码来源:TestFlushSnapshotFromClient.java


注:本文中的org.apache.hadoop.hbase.client.HBaseAdmin.execProcedure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。