Our aggregators take a bucket ordinal in `collect`, this allows us to create a single aggregator object for several buckets. For example, if we put this aggregator under a terms aggregator, a unique bucket ordinal will be associated to every term value and will be passed to this aggregator, which in turn needs to maintain separate values per bucket. So you should maintain all these variables in an array and handle resizing when needed, you can eg. have a look at how the `MaxAggregator` works