HBASE-15697 Excessive TestHRegion running time on branch-1 (Ram)
This commit is contained in:
parent
9343ef438f
commit
889d89a74c
|
@ -3874,6 +3874,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) {
|
||||||
|
@ -4040,19 +4043,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);
|
||||||
flushesSinceCompact = 0;
|
for (Store store : region.getStores()) {
|
||||||
|
store.closeAndArchiveCompactedFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue