Search in sources :

Example 1 with FlushCache

use of org.apache.hadoop.hbase.TimestampTestBase.FlushCache in project hbase by apache.

the class TestMultiVersions method testTimestamps.

/**
  * 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(name.getMethodName()));
    HColumnDescriptor hcd = new HColumnDescriptor(TimestampTestBase.FAMILY_NAME);
    hcd.setMaxVersions(3);
    desc.addFamily(hcd);
    this.admin.createTable(desc);
    Table table = UTIL.getConnection().getTable(desc.getTableName());
    // TODO: Remove these deprecated classes or pull them in here if this is
    // only test using them.
    TimestampTestBase.doTestDelete(table, 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(table, new FlushCache() {

        public void flushcache() throws IOException {
            UTIL.getMiniHBaseCluster().flushcache();
        }
    });
    table.close();
}
Also used : FlushCache(org.apache.hadoop.hbase.TimestampTestBase.FlushCache) Table(org.apache.hadoop.hbase.client.Table) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 FlushCache (org.apache.hadoop.hbase.TimestampTestBase.FlushCache)1 Table (org.apache.hadoop.hbase.client.Table)1 Test (org.junit.Test)1