HBASE-6654 io.encoding.TestChangingEncoding could be faster

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1376952 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2012-08-24 15:02:46 +00:00
parent 2c59e2bba4
commit 2b7f8503b4
1 changed files with 13 additions and 4 deletions

View File

@ -139,8 +139,9 @@ public class TestChangingEncoding {
for (int j = 0; j < NUM_COLS_PER_ROW; ++j) {
put.add(CF_BYTES, getQualifier(j),
getValue(batchId, i, j));
table.put(put);
}
put.setWriteToWAL(false);
table.put(put);
}
table.close();
}
@ -237,11 +238,19 @@ public class TestChangingEncoding {
private void compactAndWait() throws IOException, InterruptedException {
LOG.debug("Compacting table " + tableName);
admin.majorCompact(tableName);
Threads.sleepWithoutInterrupt(500);
HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0);
admin.majorCompact(tableName);
// Waiting for the compaction to start, at least .5s.
final long maxWaitime = System.currentTimeMillis() + 500;
boolean cont;
do {
cont = rs.compactSplitThread.getCompactionQueueSize() == 0;
Threads.sleep(1);
} while (cont && System.currentTimeMillis() < maxWaitime);
while (rs.compactSplitThread.getCompactionQueueSize() > 0) {
Threads.sleep(50);
Threads.sleep(1);
}
LOG.debug("Compaction queue size reached 0, continuing");
}