public class ApplicationRecordHandler implements RecordHandler<String, String>
{
private final AdderResults results;
public class ApplicationRecordHandler implements RecordHandler<String, String>
{
private final AdderResults results;
AdderResult result = state.get(partition).calculate(user);
log.info("New result for {}: {}", user, result);
results.addResults(partition, user, result);
AdderResult result = state.get(partition).calculate(user);
log.info("New result for {}: {}", user, result);
results.addResults(partition, user, result);
- state.get(partition).addToSum(user, Integer.parseInt(message));
+ if (throttle.isPresent())
+ {
+ try
+ {
+ Thread.sleep(throttle.get().toMillis());
+ }
+ catch (InterruptedException e)
+ {
+ log.warn("Intrerrupted while throttling: {}", e);
+ }
+ }