/** * Tests user specifiable time stamps putting, getting and scanning. Also * tests same in presence of deletes. Test cores are written so can be * run against an HRegion and against an HTable: i.e. both local and remote. * * <p>Port of old TestTimestamp test to here so can better utilize the spun * up cluster running more than a single test per spin up. Keep old tests' * crazyness. */ @Test public void testTimestamps() throws Exception { HTableDescriptor desc = new HTableDescriptor("testTimestamps"); desc.addFamily(new HColumnDescriptor(TimestampTestBase.FAMILY_NAME)); this.admin.createTable(desc); HTable table = new HTable(UTIL.getConfiguration(), desc.getName()); // TODO: Remove these deprecated classes or pull them in here if this is // only test using them. Incommon incommon = new HTableIncommon(table); TimestampTestBase.doTestDelete(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getHBaseCluster().flushcache(); } }); // Perhaps drop and readd the table between tests so the former does // not pollute this latter? Or put into separate tests. TimestampTestBase.doTestTimestampScanning(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getMiniHBaseCluster().flushcache(); } }); table.close(); }
/** * Tests user specifiable time stamps putting, getting and scanning. Also * tests same in presence of deletes. Test cores are written so can be * run against an HRegion and against an HTable: i.e. both local and remote. * * <p>Port of old TestTimestamp test to here so can better utilize the spun * up cluster running more than a single test per spin up. Keep old tests' * crazyness. */ @Test public void testTimestamps() throws Exception { HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("testTimestamps")); HColumnDescriptor hcd = new HColumnDescriptor(TimestampTestBase.FAMILY_NAME); hcd.setMaxVersions(3); desc.addFamily(hcd); this.admin.createTable(desc); Table table = new HTable(UTIL.getConfiguration(), desc.getTableName()); // TODO: Remove these deprecated classes or pull them in here if this is // only test using them. Incommon incommon = new HTableIncommon(table); TimestampTestBase.doTestDelete(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getHBaseCluster().flushcache(); } }); // Perhaps drop and readd the table between tests so the former does // not pollute this latter? Or put into separate tests. TimestampTestBase.doTestTimestampScanning(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getMiniHBaseCluster().flushcache(); } }); table.close(); }
/** * Tests user specifiable time stamps putting, getting and scanning. Also * tests same in presence of deletes. Test cores are written so can be * run against an HRegion and against an HTable: i.e. both local and remote. * * <p>Port of old TestTimestamp test to here so can better utilize the spun * up cluster running more than a single test per spin up. Keep old tests' * crazyness. */ @Test public void testTimestamps() throws Exception { HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("testTimestamps")); HColumnDescriptor hcd = new HColumnDescriptor(TimestampTestBase.FAMILY_NAME); hcd.setMaxVersions(3); desc.addFamily(hcd); this.admin.createTable(desc); HTable table = new HTable(UTIL.getConfiguration(), desc.getTableName()); // TODO: Remove these deprecated classes or pull them in here if this is // only test using them. Incommon incommon = new HTableIncommon(table); TimestampTestBase.doTestDelete(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getHBaseCluster().flushcache(); } }); // Perhaps drop and readd the table between tests so the former does // not pollute this latter? Or put into separate tests. TimestampTestBase.doTestTimestampScanning(incommon, new FlushCache() { public void flushcache() throws IOException { UTIL.getMiniHBaseCluster().flushcache(); } }); table.close(); }