Class Printed<K,V>
java.lang.Object
org.apache.kafka.streams.kstream.Printed<K,V>
- Type Parameters:
K- key typeV- value type
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> Printed <K, V> Print the records of aKStreamto a file.static <K,V> Printed <K, V> toSysOut()Print the records of aKStreamto system out.withKeyValueMapper(KeyValueMapper<? super K, ? super V, String> mapper) Print the records of aKStreamwith the providedKeyValueMapperThe provided KeyValueMapper's mapped value type must beString.Print the records of aKStreamwith the provided label.Print the records of aKStreamwith provided processor name.
Method Details
toFile
toSysOut
withLabel
withKeyValueMapper
Print the records of aKStreamwith the providedKeyValueMapperThe provided KeyValueMapper's mapped value type must beString.The example below shows how to customize output data.
Implementors will need to overridefinal KeyValueMapper<Integer, String, String> mapper = new KeyValueMapper<Integer, String, String>() { public String apply(Integer key, String value) { return String.format("(%d, %s)", key, value); } };toString()for keys and values that are not of typeString,Integeretc. to get meaningful information.- Parameters:
mapper- mapper to use- Returns:
- this
withName