org.apache.storm.trident.operation.builtin

## Class MaxWithComparator<T>

- java.lang.Object
- - org.apache.storm.trident.operation.BaseOperation
  - - org.apache.storm.trident.operation.BaseAggregator<ComparisonAggregator.State>
    - - org.apache.storm.trident.operation.builtin.ComparisonAggregator<T>
      - - org.apache.storm.trident.operation.builtin.MaxWithComparator<T>

- All Implemented Interfaces:
    Serializable, Aggregator<ComparisonAggregator.State>, Operation

      public class MaxWithComparator<T>
      extends ComparisonAggregator<T>

  This aggregator computes the maximum of aggregated tuples in a stream. It uses given `comparator` for comparing two values in a stream.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.storm.trident.operation.builtin.ComparisonAggregator

      `ComparisonAggregator.State`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxWithComparator(Comparator<T> comparator)`
    `MaxWithComparator(String inputFieldName, Comparator<T> comparator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected T` | `compare(T value1, T value2)`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.storm.trident.operation.builtin.ComparisonAggregator

      `aggregate, complete, init, valueFromTuple`

    - ### Methods inherited from class org.apache.storm.trident.operation.BaseOperation

      `cleanup, prepare`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.storm.trident.operation.Operation

      `cleanup, prepare`

- - ### Constructor Detail

    - #### MaxWithComparator

          public MaxWithComparator(Comparator<T> comparator)

    - #### MaxWithComparator

          public MaxWithComparator(String inputFieldName,
                                   Comparator<T> comparator)

  - ### Method Detail

    - #### compare

          protected T compare(T value1,
                              T value2)

      Specified by:
        `compare` in class `ComparisonAggregator<T>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2021 The Apache Software Foundation. All rights reserved.