Skip to content

Commit d0e4373

Browse files
committed
HBASE-22037 Re-enable TestAvoidCellReferencesIntoShippedBlocks
1 parent 0f01a02 commit d0e4373

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import org.junit.AfterClass;
5959
import org.junit.BeforeClass;
6060
import org.junit.ClassRule;
61-
import org.junit.Ignore;
6261
import org.junit.Rule;
6362
import org.junit.Test;
6463
import org.junit.experimental.categories.Category;
@@ -292,18 +291,11 @@ public boolean next(List<Cell> result, ScannerContext scannerContext) throws IOE
292291
}
293292
}
294293

295-
/**
296-
* TODO: not sure what do we test here but seems the test can not work together with async
297-
* prefetch scanner. Ignore it for now, as after HBASE-21879 is landed we will have a more natural
298-
* way to deal with reference counting...
299-
*/
300-
@Ignore
301294
@Test
302295
public void testHBASE16372InReadPath() throws Exception {
303296
final TableName tableName = TableName.valueOf(name.getMethodName());
304297
// Create a table with block size as 1024
305-
final Table table = TEST_UTIL.createTable(tableName, FAMILIES_1, 1, 1024, null);
306-
try {
298+
try (Table table = TEST_UTIL.createTable(tableName, FAMILIES_1, 1, 1024, null)) {
307299
// get the block cache and region
308300
RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName);
309301
String regionName = locator.getAllRegionLocations().get(0).getRegion().getEncodedName();
@@ -370,7 +362,8 @@ public void testHBASE16372InReadPath() throws Exception {
370362
// set partial as true so that the scan can send partial columns also
371363
s.setAllowPartialResults(true);
372364
s.setMaxResultSize(1000);
373-
try (ResultScanner scanner = table.getScanner(s)) {
365+
try (ScanPerNextResultScanner scanner =
366+
new ScanPerNextResultScanner(TEST_UTIL.getAsyncConnection().getTable(tableName), s)) {
374367
Thread evictorThread = new Thread() {
375368
@Override
376369
public void run() {
@@ -402,9 +395,8 @@ public void run() {
402395
s1.withStartRow(ROW3);
403396
s1.withStopRow(ROW5);
404397
s1.setCaching(1);
405-
ResultScanner scanner;
406-
try {
407-
scanner = table.getScanner(s1);
398+
399+
try (ResultScanner scanner = table.getScanner(s1)) {
408400
int count = Iterables.size(scanner);
409401
assertEquals("Count the rows", 2, count);
410402
int newBlockRefCount = 0;
@@ -442,8 +434,6 @@ public void run() {
442434
}
443435
}
444436
assertEquals("Count should give all rows ", 10, count);
445-
} finally {
446-
table.close();
447437
}
448438
}
449439
}

0 commit comments

Comments
 (0)