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


Java HTableDescriptor.getFamily方法代碼示例

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


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

示例1: getStore

import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
/**
 * Create a "mock" HStore that uses the tmpDir specified by the user and
 * the store dir to compact as source.
 */
private static HStore getStore(final Configuration conf, final FileSystem fs,
    final Path tableDir, final HTableDescriptor htd, final HRegionInfo hri,
    final String familyName, final Path tempDir) throws IOException {
  HRegionFileSystem regionFs = new HRegionFileSystem(conf, fs, tableDir, hri) {
    @Override
    public Path getTempDir() {
      return tempDir;
    }
  };
  HRegion region = new HRegion(regionFs, null, conf, htd, null);
  return new HStore(region, htd.getFamily(Bytes.toBytes(familyName)), conf);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:17,代碼來源:CompactionTool.java

示例2: testModifyColumnFamily

import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
@Test
public void testModifyColumnFamily() throws IOException {
  Admin admin = TEST_UTIL.getHBaseAdmin();

  HColumnDescriptor cfDescriptor = new HColumnDescriptor(FAMILY_0);
  int blockSize = cfDescriptor.getBlocksize();
  // Create a table with one families
  HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
  baseHtd.addFamily(cfDescriptor);
  admin.createTable(baseHtd);
  admin.disableTable(TABLE_NAME);
  try {
    // Verify the table descriptor
    verifyTableDescriptor(TABLE_NAME, FAMILY_0);

    int newBlockSize = 2 * blockSize;
    cfDescriptor.setBlocksize(newBlockSize);

    // Modify colymn family
    admin.modifyColumn(TABLE_NAME, cfDescriptor);

    HTableDescriptor htd = admin.getTableDescriptor(TABLE_NAME);
    HColumnDescriptor hcfd = htd.getFamily(FAMILY_0);
    assertTrue(hcfd.getBlocksize() == newBlockSize);
  } finally {
    admin.deleteTable(TABLE_NAME);
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:29,代碼來源:TestTableDescriptorModification.java

示例3: validateColumnFamilyModification

import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
public static void validateColumnFamilyModification(final HMaster master,
    final TableName tableName, final String family, HColumnDescriptor columnDescriptor)
    throws IOException {
  HTableDescriptor htd = master.getTableDescriptors().get(tableName);
  assertTrue(htd != null);

  HColumnDescriptor hcfd = htd.getFamily(family.getBytes());
  assertTrue(hcfd.equals(columnDescriptor));
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:10,代碼來源:MasterProcedureTestingUtility.java


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