use of org.apache.hadoop.hbase.client.TableDescriptorBuilder in project hbase by apache.
the class TestCompactionAfterBulkLoad method testRegionWithFamiliesAndSpecifiedTableName.
@Override
protected HRegion testRegionWithFamiliesAndSpecifiedTableName(TableName tableName, byte[]... families) throws IOException {
RegionInfo hRegionInfo = RegionInfoBuilder.newBuilder(tableName).build();
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName);
for (byte[] family : families) {
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(family));
}
ChunkCreator.initialize(MemStoreLAB.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT);
// TODO We need a way to do this without creating files
return HRegion.createHRegion(hRegionInfo, new Path(testFolder.newFolder().toURI()), conf, builder.build(), log, true, regionServerServices);
}
use of org.apache.hadoop.hbase.client.TableDescriptorBuilder in project hbase by apache.
the class TestAtomicOperation method initHRegion.
private void initHRegion(byte[] tableName, String callingMethod, int[] maxVersions, byte[]... families) throws IOException {
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TableName.valueOf(tableName));
int i = 0;
for (byte[] family : families) {
ColumnFamilyDescriptor familyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(family).setMaxVersions(maxVersions != null ? maxVersions[i++] : 1).build();
builder.setColumnFamily(familyDescriptor);
}
TableDescriptor tableDescriptor = builder.build();
RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build();
region = TEST_UTIL.createLocalHRegion(info, tableDescriptor);
}
use of org.apache.hadoop.hbase.client.TableDescriptorBuilder in project hbase by apache.
the class TestBlocksRead method initHRegion.
/**
* Callers must afterward call {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)}
*/
private HRegion initHRegion(byte[] tableName, String callingMethod, Configuration conf, String family, BlockCache blockCache) throws IOException {
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TableName.valueOf(tableName));
for (int i = 0; i < BLOOM_TYPE.length; i++) {
BloomType bloomType = BLOOM_TYPE[i];
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(family + "_" + bloomType)).setBlocksize(1).setBloomFilterType(bloomType).build());
}
RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(tableName)).build();
Path path = new Path(DIR + callingMethod);
if (blockCache != null) {
return HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build(), blockCache);
} else {
return HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build());
}
}
use of org.apache.hadoop.hbase.client.TableDescriptorBuilder in project hbase by apache.
the class AbstractTestWALReplay method createBasic3FamilyHTD.
private TableDescriptor createBasic3FamilyHTD(final TableName tableName) {
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName);
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(Bytes.toBytes("a")));
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(Bytes.toBytes("b")));
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(Bytes.toBytes("c")));
return builder.build();
}
use of org.apache.hadoop.hbase.client.TableDescriptorBuilder in project hbase by apache.
the class AbstractTestWALReplay method createBasic1FamilyHTD.
private TableDescriptor createBasic1FamilyHTD(final TableName tableName) {
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName);
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(Bytes.toBytes("a")));
return builder.build();
}
Aggregations