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


Java HBaseAdmin.enableTableAsync方法代碼示例

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


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

示例1: doQuarantineTest

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
/**
* Test that use this should have a timeout, because this method could potentially wait forever.
*/
private void doQuarantineTest(String table, HBaseFsck hbck, int check, int corrupt, int fail,
    int quar, int missing) throws Exception {
  try {
    setupTable(table);
    assertEquals(ROWKEYS.length, countRows());
    TEST_UTIL.getHBaseAdmin().flush(table); // flush is async.

    // Mess it up by leaving a hole in the assignment, meta, and hdfs data
    TEST_UTIL.getHBaseAdmin().disableTable(table);
    
    String[] args = {"-sidelineCorruptHFiles", "-repairHoles", "-ignorePreCheckPermission", table};
    ExecutorService exec = new ScheduledThreadPoolExecutor(10);
    HBaseFsck res = hbck.exec(exec, args);

    HFileCorruptionChecker hfcc = res.getHFilecorruptionChecker();
    assertEquals(hfcc.getHFilesChecked(), check);
    assertEquals(hfcc.getCorrupted().size(), corrupt);
    assertEquals(hfcc.getFailures().size(), fail);
    assertEquals(hfcc.getQuarantined().size(), quar);
    assertEquals(hfcc.getMissing().size(), missing);

    // its been fixed, verify that we can enable
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    admin.enableTableAsync(table);
    while (!admin.isTableEnabled(table)) {
      try {
        Thread.sleep(250);
      } catch (InterruptedException e) {
        e.printStackTrace();
        fail("Interrupted when trying to enable table " + table);
      }
    }
  } finally {
    deleteTable(table);
  }
}
 
開發者ID:fengchen8086,項目名稱:LCIndex-HBase-0.94.16,代碼行數:40,代碼來源:TestHBaseFsck.java

示例2: doQuarantineTest

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
/**
* Test that use this should have a timeout, because this method could potentially wait forever.
*/
private void doQuarantineTest(TableName table, HBaseFsck hbck, int check,
                              int corrupt, int fail, int quar, int missing) throws Exception {
  try {
    setupTable(table);
    assertEquals(ROWKEYS.length, countRows());
    TEST_UTIL.getHBaseAdmin().flush(table.getName()); // flush is async.

    // Mess it up by leaving a hole in the assignment, meta, and hdfs data
    TEST_UTIL.getHBaseAdmin().disableTable(table);

    String[] args = {"-sidelineCorruptHFiles", "-repairHoles", "-ignorePreCheckPermission",
        table.getNameAsString()};
    ExecutorService exec = new ScheduledThreadPoolExecutor(10);
    HBaseFsck res = hbck.exec(exec, args);

    HFileCorruptionChecker hfcc = res.getHFilecorruptionChecker();
    assertEquals(hfcc.getHFilesChecked(), check);
    assertEquals(hfcc.getCorrupted().size(), corrupt);
    assertEquals(hfcc.getFailures().size(), fail);
    assertEquals(hfcc.getQuarantined().size(), quar);
    assertEquals(hfcc.getMissing().size(), missing);

    // its been fixed, verify that we can enable
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    admin.enableTableAsync(table);
    while (!admin.isTableEnabled(table)) {
      try {
        Thread.sleep(250);
      } catch (InterruptedException e) {
        e.printStackTrace();
        fail("Interrupted when trying to enable table " + table);
      }
    }
  } finally {
    deleteTable(table);
  }
}
 
開發者ID:tenggyut,項目名稱:HIndex,代碼行數:41,代碼來源:TestHBaseFsck.java


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