Hacker News new | ask | show | jobs
by gus_massa 770 days ago
> : 4. * fractionAggregator.trues() / fractionAggregator.total();

Does that count again the number of trues each time or internaly it accumulates the number to recalculate it faster?

1 comments

The FractionAggregator class has two fields (int trues, int total), and it is up to Kafka to keep track of the accumulated number. (perhaps someone who knows Kafka better could elaborate on how Kafka stores work "under the hood")