Scan which closes before reaching end of results.
()
| 416 | |
| 417 | /** Scan which closes before reaching end of results. */ |
| 418 | @Test |
| 419 | public void scanCloseEarly() throws Exception { |
| 420 | client.setFlushInterval(FAST_FLUSH); |
| 421 | final PutRequest put1 = new PutRequest(table, "s1", family, "q", "v1"); |
| 422 | final PutRequest put2 = new PutRequest(table, "s2", family, "q", "v2"); |
| 423 | Deferred.group(client.put(put1), client.put(put2)).join(); |
| 424 | // Scan for the first row twice. |
| 425 | for (int i = 0; i < 2; i++) { |
| 426 | LOG.info("------------ iteration #" + i); |
| 427 | final Scanner scanner = client.newScanner(table); |
| 428 | scanner.setStartKey("s0"); |
| 429 | scanner.setStopKey("s3"); |
| 430 | try { |
| 431 | final ArrayList<ArrayList<KeyValue>> rows = scanner.nextRows(1).join(); |
| 432 | assertSizeIs(1, rows); |
| 433 | final ArrayList<KeyValue> kvs = rows.get(0); |
| 434 | final KeyValue kv = kvs.get(0); |
| 435 | assertSizeIs(1, kvs); |
| 436 | assertEq("s1", kv.key()); |
| 437 | assertEq("q", kv.qualifier()); |
| 438 | assertEq("v1", kv.value()); |
| 439 | } finally { |
| 440 | scanner.close().join(); |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | /** Scan with multiple qualifiers. */ |
| 446 | @Test |
nothing calls this directly
no test coverage detected