當前位置: 首頁>>代碼示例>>Java>>正文


Java HBaseAdmin.takeSnapshotAsync方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.client.HBaseAdmin.takeSnapshotAsync方法的典型用法代碼示例。如果您正苦於以下問題:Java HBaseAdmin.takeSnapshotAsync方法的具體用法?Java HBaseAdmin.takeSnapshotAsync怎麽用?Java HBaseAdmin.takeSnapshotAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hbase.client.HBaseAdmin的用法示例。


在下文中一共展示了HBaseAdmin.takeSnapshotAsync方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAsyncFlushSnapshot

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
@Test(timeout = 300000)
public void testAsyncFlushSnapshot() throws Exception {
  HBaseAdmin admin = UTIL.getHBaseAdmin();
  SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName("asyncSnapshot")
      .setTable(TABLE_NAME.getNameAsString())
      .setType(SnapshotDescription.Type.FLUSH)
      .build();

  // take the snapshot async
  admin.takeSnapshotAsync(snapshot);

  // constantly loop, looking for the snapshot to complete
  HMaster master = UTIL.getMiniHBaseCluster().getMaster();
  SnapshotTestingUtils.waitForSnapshotToComplete(master, snapshot, 200);
  LOG.info(" === Async Snapshot Completed ===");
  FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
    FSUtils.getRootDir(UTIL.getConfiguration()), LOG);
  // make sure we get the snapshot
  SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot);
}
 
開發者ID:tenggyut,項目名稱:HIndex,代碼行數:21,代碼來源:TestFlushSnapshotFromClient.java

示例2: testAsyncFlushSnapshot

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
@Test(timeout = 60000)
public void testAsyncFlushSnapshot() throws Exception {
  HBaseAdmin admin = UTIL.getHBaseAdmin();
  SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName("asyncSnapshot")
      .setTable(STRING_TABLE_NAME).setType(SnapshotDescription.Type.FLUSH).build();

  // take the snapshot async
  admin.takeSnapshotAsync(snapshot);

  // constantly loop, looking for the snapshot to complete
  HMaster master = UTIL.getMiniHBaseCluster().getMaster();
  SnapshotTestingUtils.waitForSnapshotToComplete(master, new HSnapshotDescription(snapshot), 200);
  LOG.info(" === Async Snapshot Completed ===");
  FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
    FSUtils.getRootDir(UTIL.getConfiguration()), LOG);
  // make sure we get the snapshot
  SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot);

  // test that we can delete the snapshot
  admin.deleteSnapshot(snapshot.getName());
  LOG.info(" === Async Snapshot Deleted ===");
  FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
    FSUtils.getRootDir(UTIL.getConfiguration()), LOG);
  // make sure we don't have any snapshots
  SnapshotTestingUtils.assertNoSnapshots(admin);
  LOG.info(" === Async Snapshot Test Completed ===");

}
 
開發者ID:fengchen8086,項目名稱:LCIndex-HBase-0.94.16,代碼行數:29,代碼來源:TestFlushSnapshotFromClient.java


注:本文中的org.apache.hadoop.hbase.client.HBaseAdmin.takeSnapshotAsync方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。