MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / scanCloseEarly

Method scanCloseEarly

test/TestIntegration.java:418–443  ·  view source on GitHub ↗

Scan which closes before reaching end of results.

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 13

setStartKeyMethod · 0.95
setStopKeyMethod · 0.95
nextRowsMethod · 0.95
assertSizeIsMethod · 0.95
assertEqMethod · 0.95
keyMethod · 0.95
qualifierMethod · 0.95
valueMethod · 0.95
closeMethod · 0.95
setFlushIntervalMethod · 0.80
putMethod · 0.80
newScannerMethod · 0.80

Tested by

no test coverage detected