本文整理了Java中org.apache.hadoop.hbase.client.Admin.execProcedure()
方法的一些代码示例,展示了Admin.execProcedure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.execProcedure()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!