@Override
public void scan(List<String> result, Pager pager) {
SortedSetRow idRow = (SortedSetRow)idTable.select(getId(),true);
long max = System.currentTimeMillis();
long min = max - getTTL();
List<String> ids = idRow.rangeByScore(min, max, true, pager.getOffset(), pager.getLimit());
long all = idRow.count(min, max);
String keyword = pager.getKeyword();
int offset = pager.getOffset();
int limit = pager.getLimit();
int current = 0;
for (String id:ids){
boolean match = StringUtils.isEmpty(pager.getKeyword()) || id.contains(keyword);
if (match){
if (current >= offset && current < offset + limit){
result.add(id);
}
current ++;
}
}
pager.setAll(all).setTotal(current);
}