while (exchange.next(keyFilter)) {
StaticBuffer k = getKey(exchange);
//check the key against the selector, and that is has a corresponding value
if (exchange.getValue().isDefined() && (selector == null || selector.include(k))) {
StaticBuffer v = getValue(exchange);
KeyValueEntry kv = new KeyValueEntry(k, v);
results.add(kv);
i++;
if (limit != null && limit >= 0 && i >= limit) break;
if (selector != null && selector.reachedLimit()) break;