@Override public boolean hasNext() { if (iterator == null) { // First time through iterator = query.execute().get().getList().iterator(); } else if (!iterator.hasNext() && rows == query.getRowCount()) { // only need to do another query if maximum rows were retrieved query.setStartKey(startKey); iterator = query.execute().get().getList().iterator(); rows = 0; if (iterator.hasNext()) { // First element is startKey which was the last element on the previous query result - skip it next(); } } return iterator.hasNext(); }
/** * Builds a new iterator with the given data. * * @param dictionary the store dictionary. * @param isq the indexed slice query. * @param limit the result limit. * @param cf the column family name. * @param keyspace the keyspace. */ POSSlicesQueryIterator( final ITopLevelDictionary dictionary, final IndexedSlicesQuery<byte[], Composite, byte[]> isq, final int limit, final String cf, final Keyspace keyspace) { _dictionary = dictionary; _limit = limit; _cf = cf; _keyspace = keyspace; _rows = new IndexedSlicesIterator<byte[], Composite, byte[]>(isq, new byte[0]); }
@Override public boolean hasNext() { if (iterator == null) { // First time through iterator = query.execute().get().getList().iterator(); } else if (!iterator.hasNext() && rows == query.getRowCount()) { // only need to do another query if maximum rows were retrieved query.setStartKey(startKey); iterator = query.execute().get().getList().iterator(); rows = 0; if (iterator.hasNext()) { // First element is startKey which was the last element on the previous query result - skip it next(); } } return iterator.hasNext(); }
/** * Builds a new iterator with the given data. * * @param dictionary the store dictionary. * @param isq the indexed slice query. * @param limit the result limit. * @param cf the column family name. * @param keyspace the keyspace. */ POSSlicesQueryIterator( final ITopLevelDictionary dictionary, final IndexedSlicesQuery<byte[], Composite, byte[]> isq, final int limit, final String cf, final Keyspace keyspace) { _dictionary = dictionary; _limit = limit; _cf = cf; _keyspace = keyspace; _rows = new IndexedSlicesIterator<byte[], Composite, byte[]>(isq, new byte[0]); }
@Override public boolean hasNext() { if (iterator == null) { // First time through iterator = query.execute().get().getList().iterator(); } else if (!iterator.hasNext() && rows == query.getRowCount()) { // only need to do another query if maximum rows were retrieved query.setStartKey(startKey); iterator = query.execute().get().getList().iterator(); rows = 0; if (iterator.hasNext()) { // First element is startKey which was the last element on the previous query result - skip it next(); } } return iterator.hasNext(); }