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

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

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

Admin.execProcedure介绍

[英]Execute a distributed procedure on a cluster.
[中]在集群上执行分布式过程。

代码示例

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

@Test(expected=DoNotRetryIOException.class)
public void testFastFailOnProcedureNotRegistered() throws IOException {
 Admin admin = UTIL.getAdmin();
 Map<String, String> props = new HashMap<String, String>();
 admin.execProcedure("fake1","fake2", props);
}

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

@Test
public void testExecProcedure() throws Exception {
 verifyAdminCheckForAction((admin) -> {
  // Using existing table instead of creating a new one.
  admin.execProcedure("flush-table-proc", TableName.META_TABLE_NAME.getNameAsString(),
    new HashMap<>());
 });
}

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

admin.execProcedure(LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_SIGNATURE,
 LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_NAME, props);

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

admin.execProcedure(LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_SIGNATURE,
 LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_NAME, props);

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

/**
 * Test simple flush snapshotting a table that is online
 * @throws Exception
 */
@Test
public void testFlushTableSnapshotWithProcedure() throws Exception {
 // make sure we don't fail on listing snapshots
 SnapshotTestingUtils.assertNoSnapshots(admin);
 // put some stuff in the table
 SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);
 LOG.debug("FS state before snapshot:");
 UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);
 // take a snapshot of the enabled table
 String snapshotString = "offlineTableSnapshot";
 byte[] snapshot = Bytes.toBytes(snapshotString);
 Map<String, String> props = new HashMap<>();
 props.put("table", TABLE_NAME.getNameAsString());
 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
 LOG.debug("FS state after snapshot:");
 UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);
 SnapshotTestingUtils.confirmSnapshotValid(UTIL,
  ProtobufUtil.createHBaseProtosSnapshotDesc(snapshots.get(0)), TABLE_NAME, TEST_FAM);
}

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

admin.execProcedure(LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_SIGNATURE,
 LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_NAME, props);
failStageIf(Stage.stage_2);

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

@Test(expected=DoNotRetryIOException.class)
public void testFastFailOnProcedureNotRegistered() throws IOException {
 Admin admin = UTIL.getAdmin();
 Map<String, String> props = new HashMap<String, String>();
 admin.execProcedure("fake1","fake2", props);
}

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

@Test
public void testExecProcedure() throws Exception {
 verifyAdminCheckForAction((admin) -> {
  // Using existing table instead of creating a new one.
  admin.execProcedure("flush-table-proc", TableName.META_TABLE_NAME.getNameAsString(),
    new HashMap<>());
 });
}

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

/**
 * Test simple flush snapshotting a table that is online
 * @throws Exception
 */
@Test
public void testFlushTableSnapshotWithProcedure() throws Exception {
 // make sure we don't fail on listing snapshots
 SnapshotTestingUtils.assertNoSnapshots(admin);
 // put some stuff in the table
 SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);
 LOG.debug("FS state before snapshot:");
 UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);
 // take a snapshot of the enabled table
 String snapshotString = "offlineTableSnapshot";
 byte[] snapshot = Bytes.toBytes(snapshotString);
 Map<String, String> props = new HashMap<>();
 props.put("table", TABLE_NAME.getNameAsString());
 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
 LOG.debug("FS state after snapshot:");
 UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);
 SnapshotTestingUtils.confirmSnapshotValid(UTIL,
  ProtobufUtil.createHBaseProtosSnapshotDesc(snapshots.get(0)), TABLE_NAME, TEST_FAM);
}

相关文章

Admin类方法