@Override
public void addInput(Page page)
{
checkArgument(valueChannel != -1, "Raw input is not allowed for a final aggregation");
BlockCursor values = page.getBlock(valueChannel).cursor();
BlockCursor percentiles = page.getBlock(percentileChannel).cursor();
BlockCursor masks = null;
if (maskChannel.isPresent()) {
masks = page.getBlock(maskChannel.get()).cursor();
}
BlockCursor sampleWeights = null;
if (sampleWeightChannel.isPresent()) {
sampleWeights = page.getBlock(sampleWeightChannel.get()).cursor();
}
for (int position = 0; position < page.getPositionCount(); position++) {
checkState(values.advanceNextPosition());
checkState(percentiles.advanceNextPosition());
checkState(masks == null || masks.advanceNextPosition());
checkState(sampleWeights == null || sampleWeights.advanceNextPosition());
long sampleWeight = SimpleAggregationFunction.computeSampleWeight(masks, sampleWeights);
if (!values.isNull() && sampleWeight > 0) {
addValue(digest, values, parameterType, sampleWeight);