kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cvaliente <...@git.apache.org>
Subject [GitHub] kafka pull request #3581: make Merger extend Aggregator
Date Wed, 26 Jul 2017 15:09:53 GMT
GitHub user cvaliente opened a pull request:


    make Merger extend Aggregator

    I suggest that Merger<K,V> should extend Aggregator<K,V,V>.
    Both classes usually do very similar things. A merger takes two sessions and combines
them, an aggregator takes an existing session and aggregates new values into it.
    in some use cases it is actually the same thing, e.g.:
    <null, log_event> -> .map() to <session_id,SingletonList<log_event>>
-> .groupByKey().aggregate() to <session_id, List<log_event>>
    In this case both merger and aggregator do the same thing: take two lists and combine
them into one.
    With the proposed change we could pass the Merger as both the merger and aggregator to
the .aggregate() method and keep our business logic within one merger class.
    Or in other words: The Merger is simply an Aggregator that happens to aggregate two objects
of the same class

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cvaliente/kafka KAFKA-5648-make_Merger_extend_Aggregator

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3581
commit c20cd6fc7fe5a7403584dc3e04f0b8412fa8db6f
Author: Clemens Valiente <clemens.valiente@trivago.com>
Date:   2017-07-26T15:07:55Z

    make Merger extend Aggregator


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message