/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.beam.sdk.transforms;

import org.apache.beam.sdk.transforms.Combine.CombineFn;
import org.apache.beam.sdk.util.ExecutionContext;

/**
 * An {@code Aggregator<InputT>} enables monitoring of values of type {@code InputT},
 * to be combined across all bundles.
 *
 * <p>Aggregators are created by calling
 * {@link DoFn#createAggregator DoFn.createAggregator},
 * typically from the {@link DoFn} constructor. Elements can be added to the
 * {@code Aggregator} by calling {@link Aggregator#addValue}.
 *
 * <p>It is runner-dependent whether aggregators are accessible during pipeline execution or only
 * after jobs have completed.
 *
 * <p>Example:
 * <pre>{@code
 * class MyDoFn extends DoFn<String, String> {
 *   private Aggregator<Integer, Integer> myAggregator;
 *
 *   public MyDoFn() {
 *     myAggregator = createAggregator("myAggregator", new Sum.SumIntegerFn());
 *   }
 *
 *   {@literal @}ProcessElement
 *   public void processElement(ProcessContext c) {
 *     myAggregator.addValue(1);
 *   }
 * }
 * }</pre>
 *
 * @param <InputT> the type of input values
 * @param <OutputT> the type of output values
 */
public interface Aggregator<InputT, OutputT> {

  /**
   * Adds a new value into the Aggregator.
   */
  void addValue(InputT value);

  /**
   * Returns the name of the Aggregator.
   */
  String getName();

  /**
   * Returns the {@link CombineFn}, which combines input elements in the
   * aggregator.
   */
  CombineFn<InputT, ?, OutputT> getCombineFn();

  /**
   * @deprecated this is for use only by runners and exists only for a migration period. Please
   * use the identical interface in org.apache.beam.runners.core
   */
  @Deprecated
  interface AggregatorFactory {
    /**
     * Create an aggregator with the given {@code name} and {@link CombineFn}.
     *
     *  <p>This method is called to create an aggregator for a {@link DoFn}. It receives the
     *  class of the {@link DoFn} being executed and the context of the step it is being
     *  executed in.
     */
    <InputT, AccumT, OutputT> Aggregator<InputT, OutputT> createAggregatorForDoFn(
        Class<?> fnClass, ExecutionContext.StepContext stepContext,
        String aggregatorName, CombineFn<InputT, AccumT, OutputT> combine);
  }
}

@@ -900,58 +900,8 @@
 eFn;
-%0Aimport org.apache.beam.sdk.util.ExecutionContext;
 %0A%0A/*
@@ -2247,763 +2247,7 @@
 n();
-%0A%0A  /**%0A   * @deprecated this is for use only by runners and exists only for a migration period. Please%0A   * use the identical interface in org.apache.beam.runners.core%0A   */%0A  @Deprecated%0A  interface AggregatorFactory %7B%0A    /**%0A     * Create an aggregator with the given %7B@code name%7D and %7B@link CombineFn%7D.%0A     *%0A     *  %3Cp%3EThis method is called to create an aggregator for a %7B@link DoFn%7D. It receives the%0A     *  class of the %7B@link DoFn%7D being executed and the context of the step it is being%0A     *  executed in.%0A     */%0A    %3CInputT, AccumT, OutputT%3E Aggregator%3CInputT, OutputT%3E createAggregatorForDoFn(%0A        Class%3C?%3E fnClass, ExecutionContext.StepContext stepContext,%0A        String aggregatorName, CombineFn%3CInputT, AccumT, OutputT%3E combine);%0A  %7D
 %0A%7D%0A

Remove deprecated AggregatorFactory from SDK