本文整理匯總了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);
}
示例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);
}
}
示例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));
}