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


Java Admin.deleteSnapshot方法代碼示例

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


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

示例1: deleteAllSnapshots

import org.apache.hadoop.hbase.client.Admin; //導入方法依賴的package包/類
public static void deleteAllSnapshots(final Admin admin)
    throws IOException {
  // Delete all the snapshots
  for (SnapshotDescription snapshot: admin.listSnapshots()) {
    admin.deleteSnapshot(snapshot.getName());
  }
  SnapshotTestingUtils.assertNoSnapshots(admin);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:9,代碼來源:SnapshotTestingUtils.java

示例2: testSkipFlushTableSnapshot

import org.apache.hadoop.hbase.client.Admin; //導入方法依賴的package包/類
/**
 * Test snapshotting a table that is online without flushing
 * @throws Exception
 */
@Test(timeout=30000)
public void testSkipFlushTableSnapshot() throws Exception {
  Admin admin = UTIL.getHBaseAdmin();
  // make sure we don't fail on listing snapshots
  SnapshotTestingUtils.assertNoSnapshots(admin);

  // put some stuff in the table
  try (Table table = UTIL.getConnection().getTable(TABLE_NAME)) {
    UTIL.loadTable(table, TEST_FAM);
  }

  LOG.debug("FS state before snapshot:");
  UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);

  // take a snapshot of the enabled table
  String snapshotString = "skipFlushTableSnapshot";
  byte[] snapshot = Bytes.toBytes(snapshotString);
  admin.snapshot(snapshotString, TABLE_NAME, SnapshotDescription.Type.SKIPFLUSH);
  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, snapshots.get(0), TABLE_NAME, TEST_FAM);

  admin.deleteSnapshot(snapshot);
  snapshots = admin.listSnapshots();
  SnapshotTestingUtils.assertNoSnapshots(admin);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:39,代碼來源:TestFlushSnapshotFromClient.java

示例3: cleanupSnapshot

import org.apache.hadoop.hbase.client.Admin; //導入方法依賴的package包/類
public static void cleanupSnapshot(Admin admin, String snapshotName)
    throws IOException {
  // delete the taken snapshot
  admin.deleteSnapshot(snapshotName);
  assertNoSnapshots(admin);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:7,代碼來源:SnapshotTestingUtils.java


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