Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -47,37 +48,25 @@
*/
@SuppressWarnings("deprecation")
@Category(LargeTests.class)
public class TestMobCompactionOptMode extends TestMobCompactionBase{
public class TestMobCompactionOptMode extends TestMobCompactionWithDefaults {
private static final Logger LOG =
LoggerFactory.getLogger(TestMobCompactionOptMode.class);
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestMobCompactionOptMode.class);

public TestMobCompactionOptMode() {
}

@Override
protected void initConf() {
super.initConf();
@BeforeClass
public static void configureOptimizedCompaction() throws InterruptedException, IOException {
HTU.shutdownMiniHBaseCluster();
conf.set(MobConstants.MOB_COMPACTION_TYPE_KEY,
MobConstants.OPTIMIZED_MOB_COMPACTION_TYPE);
conf.setLong(MobConstants.MOB_COMPACTION_MAX_FILE_SIZE_KEY, 1000000);
}

@Test
public void testMobFileCompactionBatchMode() throws InterruptedException, IOException {
LOG.info("MOB compaction generational (non-batch) mode started");
baseTestMobFileCompaction();
LOG.info("MOB compaction generational (non-batch) mode finished OK");

HTU.startMiniHBaseCluster();
}

@Override
protected void mobCompact(Admin admin, TableDescriptor tableDescriptor,
ColumnFamilyDescriptor familyDescriptor) throws IOException, InterruptedException {
// Major compact MOB table
admin.majorCompact(tableDescriptor.getTableName(), familyDescriptor.getName());
protected String description() {
return "generational (non-batch) mode";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -49,46 +50,43 @@
*/
@SuppressWarnings("deprecation")
@Category(LargeTests.class)
public class TestMobCompactionOptRegionBatchMode extends TestMobCompactionBase{
public class TestMobCompactionOptRegionBatchMode extends TestMobCompactionWithDefaults {
private static final Logger LOG =
LoggerFactory.getLogger(TestMobCompactionOptRegionBatchMode.class);
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestMobCompactionOptRegionBatchMode.class);

private int batchSize = 7;
private static final int batchSize = 7;
private MobFileCompactionChore compactionChore;

public TestMobCompactionOptRegionBatchMode() {
}

@Before
public void setUp() throws Exception {
super.setUp();
compactionChore = new MobFileCompactionChore(conf, batchSize);
}

protected void initConf() {
super.initConf();
@BeforeClass
public static void configureOptimizedCompactionAndBatches()
throws InterruptedException, IOException {
HTU.shutdownMiniHBaseCluster();
conf.setInt(MobConstants.MOB_MAJOR_COMPACTION_REGION_BATCH_SIZE, batchSize);
conf.set(MobConstants.MOB_COMPACTION_TYPE_KEY,
MobConstants.OPTIMIZED_MOB_COMPACTION_TYPE);
conf.setLong(MobConstants.MOB_COMPACTION_MAX_FILE_SIZE_KEY, 1000000);
HTU.startMiniHBaseCluster();
}

@Override
protected void mobCompact(Admin admin, TableDescriptor tableDescriptor,
protected void mobCompactImpl(TableDescriptor tableDescriptor,
ColumnFamilyDescriptor familyDescriptor) throws IOException, InterruptedException {
// Major compact with batch mode enabled
LOG.debug("compacting {} in batch mode.", tableDescriptor.getTableName());
compactionChore.performMajorCompactionInBatches(admin, tableDescriptor, familyDescriptor);
}

@Test
public void testMobFileCompactionBatchMode() throws InterruptedException, IOException {
LOG.info("MOB compaction chore generational batch mode started");
baseTestMobFileCompaction();
LOG.info("MOB compaction chore generational batch mode finished OK");

@Override
protected String description() {
return "generational batch mode";
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -49,43 +50,39 @@
*/
@SuppressWarnings("deprecation")
@Category(LargeTests.class)
public class TestMobCompactionRegularRegionBatchMode extends TestMobCompactionBase{
public class TestMobCompactionRegularRegionBatchMode extends TestMobCompactionWithDefaults {
private static final Logger LOG =
LoggerFactory.getLogger(TestMobCompactionRegularRegionBatchMode.class);
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestMobCompactionRegularRegionBatchMode.class);

private int batchSize = 7;
private static final int batchSize = 7;
private MobFileCompactionChore compactionChore;

public TestMobCompactionRegularRegionBatchMode() {
}

@Before
public void setUp() throws Exception {
super.setUp();
compactionChore = new MobFileCompactionChore(conf, batchSize);
}

protected void initConf() {
super.initConf();
@BeforeClass
public static void configureCompactionBatches() throws InterruptedException, IOException {
HTU.shutdownMiniHBaseCluster();
conf.setInt(MobConstants.MOB_MAJOR_COMPACTION_REGION_BATCH_SIZE, batchSize);
HTU.startMiniHBaseCluster();
}

@Override
protected void mobCompact(Admin admin, TableDescriptor tableDescriptor,
protected void mobCompactImpl(TableDescriptor tableDescriptor,
ColumnFamilyDescriptor familyDescriptor) throws IOException, InterruptedException {
// Major compact with batch mode enabled
LOG.debug("compacting {} in batch mode.", tableDescriptor.getTableName());
compactionChore.performMajorCompactionInBatches(admin, tableDescriptor, familyDescriptor);
}

@Test
public void testMobFileCompactionBatchMode() throws InterruptedException, IOException {
LOG.info("MOB compaction chore regular batch mode started");
baseTestMobFileCompaction();
LOG.info("MOB compaction chore regular batch mode finished OK");

@Override
protected String description() {
return "regular batch mode";
}

}
Loading