Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4726

ValueMapper should have (read) access to key

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 0.10.1.1
    • Fix Version/s: None
    • Component/s: streams
    • Labels:

      Description

      ValueMapper should have read-only access to the key for the value it is mapping. Sometimes the value transformation will depend on the key.

      It is possible to do this with a full blown KeyValueMapper but that loses the promise that you won't change the key – so you might introduce a re-keying phase that is totally unnecessary. It also requires you to return an identity KeyValue object which costs something to construct (unless we are lucky and the optimizer elides it).

      [ If mapValues() is guaranteed to be no less efficient than map() the issue may be moot, but I presume there are some optimizations that are valid with the former but not latter. ]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jeyhunkarimov Jeyhun Karimov
                Reporter:
                stevenschlansker Steven Schlansker
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: