private HTableDescriptor createTableDescriptor(TableName tableName, boolean hasMob) { HTableDescriptor htd = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(FAMILY); if (hasMob) { hcd.setMobEnabled(true); hcd.setMobThreshold(0); } htd.addFamily(hcd); return htd; }
/** * Create the mob store file */ private Path createMobStoreFile(Configuration conf, String family) throws IOException { HColumnDescriptor hcd = new HColumnDescriptor(family); hcd.setMaxVersions(4); hcd.setMobEnabled(true); return createMobStoreFile(hcd); }
public void setUp(String tableNameAsString) throws IOException { tableName = TableName.valueOf(tableNameAsString); hcd1 = new HColumnDescriptor(family1); hcd1.setMobEnabled(true); hcd1.setMobThreshold(5); hcd2 = new HColumnDescriptor(family2); hcd2.setMobEnabled(true); hcd2.setMobThreshold(5); desc = new HTableDescriptor(tableName); desc.addFamily(hcd1); desc.addFamily(hcd2); admin.createTable(desc, getSplitKeys()); table = conn.getTable(tableName); bufMut = conn.getBufferedMutator(tableName); }
@Test public void testFlushMobFile() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(family); hcd.setMobEnabled(true); hcd.setMobThreshold(3L); hcd.setMaxVersions(4); desc.addFamily(hcd); testFlushFile(desc); }
private void setUpForPolicyTest(String tableNameAsString, MobCompactPartitionPolicy type) throws IOException { tableName = TableName.valueOf(tableNameAsString); hcd1 = new HColumnDescriptor(family1); hcd1.setMobEnabled(true); hcd1.setMobThreshold(10); hcd1.setMobCompactPartitionPolicy(type); desc = new HTableDescriptor(tableName); desc.addFamily(hcd1); admin.createTable(desc); table = conn.getTable(tableName); bufMut = conn.getBufferedMutator(tableName); }
/** * Setup a clean table with a mob-enabled column. * * @param tablename The name of a table to be created. * @throws Exception */ void setupMobTable(TableName tablename) throws Exception { HTableDescriptor desc = new HTableDescriptor(tablename); HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM)); hcd.setMobEnabled(true); hcd.setMobThreshold(0); desc.addFamily(hcd); // If a table has no CF's it doesn't get checked createTable(TEST_UTIL, desc, SPLITS); tbl = connection.getTable(tablename, tableExecutorService); List<Put> puts = new ArrayList<>(ROWKEYS.length); for (byte[] row : ROWKEYS) { Put p = new Put(row); p.addColumn(FAM, Bytes.toBytes("val"), row); puts.add(p); } tbl.put(puts); }
private void modifyColumnExpiryDays(int expireDays) throws Exception { HColumnDescriptor hcd = new HColumnDescriptor(family); hcd.setMobEnabled(true); hcd.setMobThreshold(3L); // change ttl as expire days to make some row expired int timeToLive = expireDays * secondsOfDay(); hcd.setTimeToLive(timeToLive); admin.modifyColumnFamily(tableName, hcd); }
public void setUp(long threshold, String TN, DataBlockEncoding encoding) throws Exception { desc = new HTableDescriptor(TableName.valueOf(TN)); hcd = new HColumnDescriptor(family); hcd.setMobEnabled(true); hcd.setMobThreshold(threshold); hcd.setMaxVersions(4); hcd.setDataBlockEncoding(encoding); desc.addFamily(hcd); admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getTable(TableName.valueOf(TN)); }
private void init() throws Exception { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(family); hcd.setMobEnabled(true); hcd.setMobThreshold(3L); hcd.setMaxVersions(4); desc.addFamily(hcd); admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getBufferedMutator(tableName); }
@Before public void setUp() throws Exception { UTIL = HBaseTestingUtility.createLocalHTU(); conf = UTIL.getConfiguration(); conf.set(MobConstants.MOB_FILE_CACHE_SIZE_KEY, TEST_CACHE_SIZE); HTableDescriptor htd = UTIL.createTableDescriptor("testMobFileCache"); HColumnDescriptor hcd1 = new HColumnDescriptor(FAMILY1); hcd1.setMobEnabled(true); hcd1.setMobThreshold(0); HColumnDescriptor hcd2 = new HColumnDescriptor(FAMILY2); hcd2.setMobEnabled(true); hcd2.setMobThreshold(0); HColumnDescriptor hcd3 = new HColumnDescriptor(FAMILY3); hcd3.setMobEnabled(true); hcd3.setMobThreshold(0); htd.addFamily(hcd1); htd.addFamily(hcd2); htd.addFamily(hcd3); RegionInfo regionInfo = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); mobFileCache = new MobFileCache(conf); region = HBaseTestingUtility .createRegionAndWAL(regionInfo, UTIL.getDataTestDir(), conf, htd, mobFileCache); }
public void setUp(long threshold, TableName tn) throws Exception { conf = TEST_UTIL.getConfiguration(); fs = FileSystem.get(conf); desc = new HTableDescriptor(tn); hcd = new HColumnDescriptor(family); hcd.setMobEnabled(true); hcd.setMobThreshold(threshold); hcd.setMaxVersions(4); desc.addFamily(hcd); admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getTable(tn); }
hcd.setMobEnabled(true); hcd.setMobThreshold(4);
private void init(Configuration conf, long mobThreshold) throws Exception { this.conf = conf; this.mobCellThreshold = mobThreshold; HBaseTestingUtility UTIL = new HBaseTestingUtility(conf); compactionThreshold = conf.getInt("hbase.hstore.compactionThreshold", 3); htd = UTIL.createTableDescriptor(name.getMethodName()); hcd = new HColumnDescriptor(COLUMN_FAMILY); hcd.setMobEnabled(true); hcd.setMobThreshold(mobThreshold); hcd.setMaxVersions(1); htd.modifyFamily(hcd); RegionInfo regionInfo = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); region = HBaseTestingUtility .createRegionAndWAL(regionInfo, UTIL.getDataTestDir(), conf, htd, new MobFileCache(conf)); fs = FileSystem.get(conf); }
hcd.setMobEnabled(true); hcd.setMobThreshold(0L); table1Desc.addFamily(hcd);
hdt.addCoprocessor(CompactTwoLatestHfilesCopro.class.getName()); HColumnDescriptor hcd = new HColumnDescriptor(fam); hcd.setMobEnabled(true); hcd.setMobThreshold(10); hcd.setMaxVersions(1);
HTableDescriptor htd = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(cf); hcd.setMobEnabled(true); hcd.setMobThreshold(0); htd.addFamily(hcd);
HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor hcd1 = new HColumnDescriptor(family1); hcd1.setMobEnabled(true); hcd1.setMobThreshold(0); hcd1.setEncryptionType(algorithm); hcd1.setEncryptionKey(encryptionKey); HColumnDescriptor hcd2 = new HColumnDescriptor(family2); hcd2.setMobEnabled(true); hcd2.setMobThreshold(0); desc.addFamily(hcd1);
mobHcd.setMobEnabled(true); mobHcd.setMobThreshold(5L); table1Desc.addFamily(mobHcd);
hcd.setBloomFilterType(BloomType.ROW); hcd.setCompressionType(Algorithm.SNAPPY); hcd.setMobEnabled(true); hcd.setMobThreshold(1000L); hcd.setDFSReplication((short) v);
hcd.setBloomFilterType(BloomType.ROW); hcd.setCompressionType(Algorithm.SNAPPY); hcd.setMobEnabled(true); hcd.setMobThreshold(1000L); hcd.setDFSReplication((short) v);