Child pages
  • KIP-132: Augment KStream.print to allow extra parameters in the printed string
Skip to end of metadata
Go to start of metadata

Status

Current stateUnder Discussion

Discussion thread:

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

As for now, KStream#print leads to a predefined output where key and value are printed with comma separation:

We therefore suggest to extend print in a way that it takes KeyValueMapper as a parameter, to let the user modify the output according to its needs. If a mapper is present, the hard-coded key-value output can be replaced with:

Public Interfaces

The affected interface is KStream, which needs to be extended with another overloaded version of print:

Proposed Changes

Apart from the extension of the interface, the previous implementation of print will be call a new overloaded version thereof. In case no KeyValuemapper is set, null serves as the indicator to use the default output:

 

 

Compatibility, Deprecation, and Migration Plan

The extension of print will not introduce compatibility issues. Further more, we can maintain the current output by keeping the current output format as a default (if mapper was not set):

 

 

  • No labels