HBASE-12199 Make TestAtomicOperation and TestEncodedSeekers faster

Signed-off-by: Elliott Clark <eclark@apache.org>
This commit is contained in:
manukranthk 2014-10-07 17:07:19 -07:00 committed by Elliott Clark
parent b7f6753e2e
commit 283ec57641
2 changed files with 12 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.MediumTests;
import org.apache.hadoop.hbase.Tag;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
@ -142,6 +143,7 @@ public class TestEncodedSeekers {
byte[] key = LoadTestKVGenerator.md5PrefixedKey(i).getBytes();
for (int j = 0; j < NUM_COLS_PER_ROW; ++j) {
Put put = new Put(key);
put.setDurability(Durability.ASYNC_WAL);
byte[] col = Bytes.toBytes(String.valueOf(j));
byte[] value = dataGenerator.generateRandomSizeValue(key, col);
if (includeTags) {

View File

@ -70,7 +70,6 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
/**
* Testing of HRegion.incrementColumnValue, HRegion.increment,
* and HRegion.append
@ -237,6 +236,7 @@ public class TestAtomicOperation {
inc.addColumn(fam1, qual1, amount);
inc.addColumn(fam1, qual2, amount*2);
inc.addColumn(fam2, qual3, amount*3);
inc.setDurability(Durability.ASYNC_WAL);
region.increment(inc);
// verify: Make sure we only see completed increments
@ -274,6 +274,7 @@ public class TestAtomicOperation {
a.add(fam1, qual1, val);
a.add(fam1, qual2, val);
a.add(fam2, qual3, val);
a.setDurability(Durability.ASYNC_WAL);
region.append(a);
Get g = new Get(row);
@ -349,16 +350,20 @@ public class TestAtomicOperation {
if (op) {
Put p = new Put(row, ts);
p.add(fam1, qual1, value1);
p.setDurability(Durability.ASYNC_WAL);
rm.add(p);
Delete d = new Delete(row);
d.deleteColumns(fam1, qual2, ts);
d.setDurability(Durability.ASYNC_WAL);
rm.add(d);
} else {
Delete d = new Delete(row);
d.deleteColumns(fam1, qual1, ts);
d.setDurability(Durability.ASYNC_WAL);
rm.add(d);
Put p = new Put(row, ts);
p.add(fam1, qual2, value2);
p.setDurability(Durability.ASYNC_WAL);
rm.add(p);
}
region.mutateRow(rm);
@ -438,15 +443,19 @@ public class TestAtomicOperation {
if (op) {
Put p = new Put(row2, ts);
p.add(fam1, qual1, value1);
p.setDurability(Durability.ASYNC_WAL);
mrm.add(p);
Delete d = new Delete(row);
d.deleteColumns(fam1, qual1, ts);
d.setDurability(Durability.ASYNC_WAL);
mrm.add(d);
} else {
Delete d = new Delete(row2);
d.deleteColumns(fam1, qual1, ts);
d.setDurability(Durability.ASYNC_WAL);
mrm.add(d);
Put p = new Put(row, ts);
p.setDurability(Durability.ASYNC_WAL);
p.add(fam1, qual1, value2);
mrm.add(p);
}