this. {@link #setMaxNumRows setMaxNumRows}(nrows); this. {@link #nextRows() nextRows}();
490491492493494495496497498499500
final Scanner fake_scanner = mock(Scanner.class); when(client.newScanner(table)) .thenReturn(fake_scanner); when(fake_scanner.nextRows()) .thenReturn(Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(null)); // Watch this! ______,^ I'm writing C++ in Java! final List<String> suggestions = uid.suggest("nomatch"); assertEquals(0, suggestions.size()); // No results.
523524525526527528529530531532533
row = new ArrayList<KeyValue>(1); row.add(new KeyValue("foo.baz".getBytes(), ID, kind_array, new byte[] { 0, 0, 2 })); rows.add(row); } when(fake_scanner.nextRows()) .thenReturn(Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(rows)) .thenReturn(Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(null)); // Watch this! ______,^ I'm writing C++ in Java! final List<String> suggestions = uid.suggest("foo");
153154155156157158159160161162163
scanner.setQualifier(PASSWORD_COL); ArrayList<ArrayList<KeyValue>> rows = null; ArrayList<Deferred<Boolean>> workers = new ArrayList<Deferred<Boolean>>(); while ((rows = scanner.nextRows(1).joinUninterruptibly()) != null) { LOG.info("received a page of users."); for (ArrayList<KeyValue> row : rows) { KeyValue kv = row.get(0); byte[] expected = kv.value(); String userId = new String(kv.key());