Class PartialAggregationController

java.lang.Object
io.trino.operator.aggregation.partial.PartialAggregationController

public class PartialAggregationController extends Object
Controls whenever partial aggregation is enabled across all HashAggregationOperators for a particular plan node on a single node. Partial aggregation is disabled after sampling sufficient amount of input and the ratio between output(unique) and input rows is too high (> uniqueRowsRatioThreshold).

The class is thread safe and objects of this class are used potentially by multiple threads/drivers simultaneously. Different threads either: - modify fields via synchronized onFlush(long, long, java.util.OptionalLong). - read volatile partialAggregationDisabled (volatile here gives visibility).

  • Constructor Details

    • PartialAggregationController

      public PartialAggregationController(io.airlift.units.DataSize maxPartialMemory, double uniqueRowsRatioThreshold)
  • Method Details

    • isPartialAggregationDisabled

      public boolean isPartialAggregationDisabled()
    • onFlush

      public void onFlush(long bytesProcessed, long rowsProcessed, OptionalLong uniqueRowsProduced)
    • duplicate

      public PartialAggregationController duplicate()