Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8
    • Component/s: core-libs
    • Labels:

      Description

      The Collector API, as initially specified, allows mutable reduction operations to be expressed in terms of three functions:
       - create new result container
       - incorporate one new data element into a result container
       - merge two result containers
       
      This is suitable for many summarization operations, such as simple reductions (e.g., sum, min, max), group-by, partition-by, etc. However, it is constraining that the intermediate type used for accumulation and the final result type must be the same; some problems, such as averaging, require a different internal type than final result type. (When averaging, a sensible intermediate representation is a holder for two mutable accumulators, sum and count, but the user almost always wants a double as the final result.) Additionally, it may be the case that there are invariants that the Collector would like to impose on its result (e.g., immutability, or tree balancing) that cannot be done efficiently by the accumulator.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                henryjen Henry Jen
                Reporter:
                briangoetz Brian Goetz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: