HBASE-15697 Excessive TestHRegion running time on branch-1 (Ram)

This commit is contained in:
Vasudevan 2016-04-28 14:15:43 +05:30 committed by Ramkrishna
parent 4f2d8dc328
commit 2b0913eea4
1 changed files with 8 additions and 9 deletions

View File

@ -3864,6 +3864,9 @@ public class TestHRegion {
if (i != 0 && i % compactInterval == 0) {
region.compact(true);
for (Store store : region.getStores()) {
store.closeAndArchiveCompactedFiles();
}
}
if (i != 0 && i % flushInterval == 0) {
@ -4031,19 +4034,15 @@ public class TestHRegion {
// Add a thread that flushes as fast as possible
ctx.addThread(new RepeatingTestThread(ctx) {
private int flushesSinceCompact = 0;
private final int maxFlushesSinceCompact = 20;
@Override
public void doAnAction() throws Exception {
if (region.flush(true).isCompactionNeeded()) {
++flushesSinceCompact;
}
region.flush(true);
// Compact regularly to avoid creating too many files and exceeding
// the ulimit.
if (flushesSinceCompact == maxFlushesSinceCompact) {
region.compact(false);
flushesSinceCompact = 0;
region.compact(false);
for (Store store : region.getStores()) {
store.closeAndArchiveCompactedFiles();
}
}
});
@ -4056,7 +4055,7 @@ public class TestHRegion {
long prevTimestamp = 0L;
for (int i = 0; i < testCount; i++) {
LOG.info("testWritesWhileGetting verify turn " + i);
boolean previousEmpty = result == null || result.isEmpty();
result = region.get(get);
if (!result.isEmpty() || !previousEmpty || i > compactInterval) {