AggregatorFactory: Use guessAggregatorHeapFootprint when factorizeWithSize is not implemented. (#14567)

There are two ways of estimating heap footprint of an Aggregator:

1) AggregatorFactory#guessAggregatorHeapFootprint
2) AggregatorFactory#factorizeWithSize + Aggregator#aggregateWithSize

When the second path is used, the default implementation of factorizeWithSize
is now updated to delegate to guessAggregatorHeapFootprint, making these equivalent.
The old logic used getMaxIntermediateSize, which is less accurate.

Also fixes a bug where, when using the second path, calling factorizeWithSize
on PassthroughAggregatorFactory would fail because getMaxIntermediateSize was
not implemented. (There is no buffer aggregator, so there would be no need.)
This commit is contained in:
Gian Merlino 2023-07-12 07:33:27 -07:00 committed by GitHub
parent 7142b0c39e
commit cc8b210e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ public abstract class AggregatorFactory implements Cacheable
*/
public AggregatorAndSize factorizeWithSize(ColumnSelectorFactory metricFactory)
{
return new AggregatorAndSize(factorize(metricFactory), getMaxIntermediateSize());
return new AggregatorAndSize(factorize(metricFactory), guessAggregatorHeapFootprint(0));
}
/**