private void runQuery(K start, K end) { query.setKeys(start, end); if(!firstRun) { query.setRowCount(rowCount); } rowsIterator = null; QueryResult<OrderedRows<K, String, String>> result = query.execute(); OrderedRows<K, String, String> rows = (result != null) ? result.get() : null; rowsIterator = (rows != null) ? rows.iterator() : null; // we'll skip this first one, since it is the same as the last one from previous time we executed if (!firstRun && rowsIterator != null) rowsIterator.next(); firstRun = false; if (rowsIterator != null && !rowsIterator.hasNext()) { nextValue = null; // all done. our iterator's hasNext() will now return false; } else { findNext(true); } }
private void runQuery(K start, K end) { query.setKeys(start, end); rowsIterator = null; QueryResult<OrderedRows<K, String, String>> result = query.execute(); OrderedRows<K, String, String> rows = (result != null) ? result.get() : null; rowsIterator = (rows != null) ? rows.iterator() : null; // we'll skip this first one, since it is the same as the last one from previous time we executed if (!firstRun && rowsIterator != null) rowsIterator.next(); firstRun = false; if (!rowsIterator.hasNext()) { nextValue = null; // all done. our iterator's hasNext() will now return false; } else { findNext(true); } }
private void runQuery(K start, K end) { query.setKeys(start, end); if(!firstRun) { query.setRowCount(rowCount); } rowsIterator = null; QueryResult<OrderedRows<K, String, String>> result = query.execute(); OrderedRows<K, String, String> rows = (result != null) ? result.get() : null; rowsIterator = (rows != null) ? rows.iterator() : null; // we'll skip this first one, since it is the same as the last one from previous time we executed if (!firstRun && rowsIterator != null) rowsIterator.next(); firstRun = false; if (rowsIterator != null && !rowsIterator.hasNext()) { nextValue = null; // all done. our iterator's hasNext() will now return false; } else { findNext(true); } }