Package org.apache.storm.trident.operation.builtin

## Class ComparisonAggregator<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>

- All Implemented Interfaces:
    `Serializable`, `Aggregator<ComparisonAggregator.State>`, `Operation`
  Direct Known Subclasses:
    `Max`, `MaxWithComparator`, `Min`, `MinWithComparator`

      public abstract class ComparisonAggregator<T>
      extends BaseAggregator<ComparisonAggregator.State>

  Abstract `Aggregator` for comparing two values in a stream.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `ComparisonAggregator.State` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ComparisonAggregator​(String inputFieldName)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `aggregate​(ComparisonAggregator.State state, TridentTuple tuple, TridentCollector collector)` |
    `protected abstract T` | `compare​(T value1, T value2)` |
    `void` | `complete​(ComparisonAggregator.State state, TridentCollector collector)` |
    `ComparisonAggregator.State` | `init​(Object batchId, TridentCollector collector)` |
    `protected T` | `valueFromTuple​(TridentTuple tuple)` |

    - ### 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, toString, wait, wait, wait`

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

      `cleanup, prepare`

- - ### Constructor Detail

    - #### ComparisonAggregator

          public ComparisonAggregator​(String inputFieldName)

  - ### Method Detail

    - #### compare

          protected abstract T compare​(T value1,
                                       T value2)

    - #### init

          public ComparisonAggregator.State init​(Object batchId,
                                                 TridentCollector collector)

    - #### aggregate

          public void aggregate​(ComparisonAggregator.State state,
                                TridentTuple tuple,
                                TridentCollector collector)

    - #### valueFromTuple

          protected T valueFromTuple​(TridentTuple tuple)

    - #### complete

          public void complete​(ComparisonAggregator.State state,
                               TridentCollector collector)