HBASE-12384 TestTags can hang on fast test hosts
This commit is contained in:
parent
075fd30321
commit
f20fac41df
|
@ -125,13 +125,12 @@ public class TestTags {
|
||||||
put.setAttribute("visibility", Bytes.toBytes("myTag"));
|
put.setAttribute("visibility", Bytes.toBytes("myTag"));
|
||||||
table.put(put);
|
table.put(put);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
List<HRegion> regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
|
// We are lacking an API for confirming flush request compaction.
|
||||||
for (HRegion region : regions) {
|
// Just sleep for a short time. We won't be able to confirm flush
|
||||||
Store store = region.getStore(fam);
|
// completion but the test won't hang now or in the future if
|
||||||
while (!(store.getStorefilesCount() > 0)) {
|
// default compaction policy causes compaction between flush and
|
||||||
Thread.sleep(10);
|
// when we go to confirm it.
|
||||||
}
|
Thread.sleep(1000);
|
||||||
}
|
|
||||||
|
|
||||||
Put put1 = new Put(row1);
|
Put put1 = new Put(row1);
|
||||||
byte[] value1 = Bytes.toBytes("1000dfsdf");
|
byte[] value1 = Bytes.toBytes("1000dfsdf");
|
||||||
|
@ -139,29 +138,18 @@ public class TestTags {
|
||||||
// put1.setAttribute("visibility", Bytes.toBytes("myTag3"));
|
// put1.setAttribute("visibility", Bytes.toBytes("myTag3"));
|
||||||
table.put(put1);
|
table.put(put1);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 1)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Put put2 = new Put(row2);
|
Put put2 = new Put(row2);
|
||||||
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
||||||
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
||||||
put2.setAttribute("visibility", Bytes.toBytes("myTag3"));
|
put2.setAttribute("visibility", Bytes.toBytes("myTag3"));
|
||||||
table.put(put2);
|
table.put(put2);
|
||||||
|
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName.getName());
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 2)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result(fam, row, qual, row2, table, value, value2, row1, value1);
|
result(fam, row, qual, row2, table, value, value2, row1, value1);
|
||||||
|
|
||||||
admin.compact(tableName);
|
admin.compact(tableName);
|
||||||
while (admin.getCompactionState(tableName) != CompactionState.NONE) {
|
while (admin.getCompactionState(tableName) != CompactionState.NONE) {
|
||||||
Thread.sleep(10);
|
Thread.sleep(10);
|
||||||
|
@ -203,40 +191,27 @@ public class TestTags {
|
||||||
put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value);
|
put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value);
|
||||||
table.put(put);
|
table.put(put);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
List<HRegion> regions = TEST_UTIL.getHBaseCluster().getRegions(tableName.getName());
|
// We are lacking an API for confirming flush request compaction.
|
||||||
for (HRegion region : regions) {
|
// Just sleep for a short time. We won't be able to confirm flush
|
||||||
Store store = region.getStore(fam);
|
// completion but the test won't hang now or in the future if
|
||||||
while (!(store.getStorefilesCount() > 0)) {
|
// default compaction policy causes compaction between flush and
|
||||||
Thread.sleep(10);
|
// when we go to confirm it.
|
||||||
}
|
Thread.sleep(1000);
|
||||||
}
|
|
||||||
|
|
||||||
Put put1 = new Put(row1);
|
Put put1 = new Put(row1);
|
||||||
byte[] value1 = Bytes.toBytes("1000dfsdf");
|
byte[] value1 = Bytes.toBytes("1000dfsdf");
|
||||||
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
||||||
table.put(put1);
|
table.put(put1);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName.getName());
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 1)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Put put2 = new Put(row2);
|
Put put2 = new Put(row2);
|
||||||
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
||||||
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
||||||
table.put(put2);
|
table.put(put2);
|
||||||
|
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 2)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Scan s = new Scan(row);
|
Scan s = new Scan(row);
|
||||||
ResultScanner scanner = table.getScanner(s);
|
ResultScanner scanner = table.getScanner(s);
|
||||||
try {
|
try {
|
||||||
|
@ -312,26 +287,20 @@ public class TestTags {
|
||||||
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
||||||
table.put(put1);
|
table.put(put1);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
List<HRegion> regions = TEST_UTIL.getHBaseCluster().getRegions(tableName.getName());
|
// We are lacking an API for confirming flush request compaction.
|
||||||
for (HRegion region : regions) {
|
// Just sleep for a short time. We won't be able to confirm flush
|
||||||
Store store = region.getStore(fam);
|
// completion but the test won't hang now or in the future if
|
||||||
while (!(store.getStorefilesCount() > 0)) {
|
// default compaction policy causes compaction between flush and
|
||||||
Thread.sleep(10);
|
// when we go to confirm it.
|
||||||
}
|
Thread.sleep(1000);
|
||||||
}
|
|
||||||
|
|
||||||
put1 = new Put(row2);
|
put1 = new Put(row2);
|
||||||
value1 = Bytes.toBytes("1000dfsdf");
|
value1 = Bytes.toBytes("1000dfsdf");
|
||||||
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
put1.add(fam, qual, HConstants.LATEST_TIMESTAMP, value1);
|
||||||
table.put(put1);
|
table.put(put1);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 1)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Put put2 = new Put(rowd);
|
Put put2 = new Put(rowd);
|
||||||
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
byte[] value2 = Bytes.toBytes("1000dfsdf");
|
||||||
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
put2.add(fam, qual, HConstants.LATEST_TIMESTAMP, value2);
|
||||||
|
@ -342,13 +311,8 @@ public class TestTags {
|
||||||
put.setAttribute("visibility", Bytes.toBytes("ram"));
|
put.setAttribute("visibility", Bytes.toBytes("ram"));
|
||||||
table.put(put2);
|
table.put(put2);
|
||||||
admin.flush(tableName);
|
admin.flush(tableName);
|
||||||
regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
|
Thread.sleep(1000);
|
||||||
for (HRegion region : regions) {
|
|
||||||
Store store = region.getStore(fam);
|
|
||||||
while (!(store.getStorefilesCount() > 2)) {
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TestCoprocessorForTags.checkTagPresence = true;
|
TestCoprocessorForTags.checkTagPresence = true;
|
||||||
Scan s = new Scan(row);
|
Scan s = new Scan(row);
|
||||||
s.setCaching(1);
|
s.setCaching(1);
|
||||||
|
|
Loading…
Reference in New Issue