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