kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clemens Valiente (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KAFKA-5648) make Merger extend Aggregator
Date Wed, 26 Jul 2017 15:08:00 GMT
Clemens Valiente created KAFKA-5648:
---------------------------------------

             Summary: make Merger extend Aggregator
                 Key: KAFKA-5648
                 URL: https://issues.apache.org/jira/browse/KAFKA-5648
             Project: Kafka
          Issue Type: New Feature
          Components: streams
    Affects Versions: 0.11.0.0
            Reporter: Clemens Valiente
            Assignee: Clemens Valiente
            Priority: Minor


Hi,

I suggest that Merger<K,V> should extend Aggregator<K,V,V>.
reason:
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




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message