You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Clemens Valiente (JIRA)" <ji...@apache.org> on 2017/07/26 15:08:00 UTC
[jira] [Created] (KAFKA-5648) make Merger extend Aggregator
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)