private int scan(ModulusParams lmp, Range range) throws TableNotFoundException {
Scanner scanner = env.getConnector().createScanner(env.getTable(), env.getAuthorizations());
scanner.setRange(range);
Notification.configureScanner(scanner);
IteratorSetting iterCfg = new IteratorSetting(30, "nhf", NotificationHashFilter.class);
NotificationHashFilter.setModulusParams(iterCfg, lmp.divisor, lmp.remainder);
scanner.addScanIterator(iterCfg);
int count = 0;
for (Entry<Key, Value> entry : scanner) {
if (lmp.update != hwf.getModulusParams().update) {
throw new HashNotificationFinder.ModParamsChangedException();
}
if (stopped.get()) {
return count;
}
if (hwf.getWorkerQueue().addNotification(hwf, Notification.from(entry.getKey()))) {
count++;
}
}
return count;
}