diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java b/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java index 882f0550f6d..255ccb7c636 100644 --- a/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java +++ b/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java @@ -879,7 +879,10 @@ public interface KStream { * A {@link Transformer} (provided by the given {@link TransformerSupplier}) is applied to each input record and * returns zero or one output record. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #map(KeyValueMapper) map()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #map(KeyValueMapper) map()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #map(KeyValueMapper) map()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()}, * the processing progress can be observed and additional periodic actions can be performed. *

@@ -970,7 +973,10 @@ public interface KStream { * A {@link Transformer} (provided by the given {@link TransformerSupplier}) is applied to each input record and * returns zero or one output record. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #map(KeyValueMapper) map()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #map(KeyValueMapper) map()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #map(KeyValueMapper) map()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()}, * the processing progress can be observed and additional periodic actions can be performed. *

@@ -1063,8 +1069,9 @@ public interface KStream { * A {@link Transformer} (provided by the given {@link TransformerSupplier}) is applied to each input record and * returns zero or more output records. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #flatMap(KeyValueMapper) flatMap()} for stateless - * record transformation). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #flatMap(KeyValueMapper) flatMap()). + * If you choose not to attach one, this operation is similar to the stateless {@link #flatMap(KeyValueMapper) flatMap() + * but allows access to the {@code ProcessorContext} and record metadata. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()} * the processing progress can be observed and additional periodic actions can be performed. *

@@ -1155,8 +1162,9 @@ public interface KStream { * A {@link Transformer} (provided by the given {@link TransformerSupplier}) is applied to each input record and * returns zero or more output records. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #flatMap(KeyValueMapper) flatMap()} for stateless - * record transformation). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #flatMap(KeyValueMapper) flatMap()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #flatMap(KeyValueMapper) flatMap()} + * but allows access to the {@code ProcessorContext} and record metadata. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()} * the processing progress can be observed and additional periodic actions can be performed. *

@@ -1248,7 +1256,9 @@ public interface KStream { * A {@link ValueTransformer} (provided by the given {@link ValueTransformerSupplier}) is applied to each input * record value and computes a new value for it. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapper) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. *

@@ -1323,7 +1333,10 @@ public interface KStream { * A {@link ValueTransformer} (provided by the given {@link ValueTransformerSupplier}) is applied to each input * record value and computes a new value for it. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapper) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. *

@@ -1401,7 +1414,10 @@ public interface KStream { * A {@link ValueTransformerWithKey} (provided by the given {@link ValueTransformerWithKeySupplier}) is applied to * each input record value and computes a new value for it. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapperWithKey)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapperWithKey) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapperWithKey) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. *

@@ -1480,7 +1496,10 @@ public interface KStream { * A {@link ValueTransformerWithKey} (provided by the given {@link ValueTransformerWithKeySupplier}) is applied to * each input record value and computes a new value for it. * Thus, an input record {@code } can be transformed into an output record {@code }. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapperWithKey)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapperWithKey) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapperWithKey) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. *

@@ -1561,7 +1580,10 @@ public interface KStream { * A {@link ValueTransformer} (provided by the given {@link ValueTransformerSupplier}) is applied to each input * record value and computes zero or more new values. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapper) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()} * the processing progress can be observed and additional periodic actions can be performed. *

@@ -1647,7 +1669,10 @@ public interface KStream { * A {@link ValueTransformer} (provided by the given {@link ValueTransformerSupplier}) is applied to each input * record value and computes zero or more new values. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #mapValues(ValueMapper) mapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #mapValues(ValueMapper) mapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long) Punctuator#punctuate()} * the processing progress can be observed and additional periodic actions can be performed. *

@@ -1735,7 +1760,10 @@ public interface KStream { * A {@link ValueTransformerWithKey} (provided by the given {@link ValueTransformerWithKeySupplier}) is applied to * each input record value and computes zero or more new values. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #flatMapValues(ValueMapperWithKey) flatMapValues()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #flatMapValues(ValueMapperWithKey) flatMapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #flatMapValues(ValueMapperWithKey) flatMapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress can * be observed and additional periodic actions can be performed. *

@@ -1822,7 +1850,10 @@ public interface KStream { * A {@link ValueTransformerWithKey} (provided by the given {@link ValueTransformerWithKeySupplier}) is applied to * each input record value and computes zero or more new values. * Thus, an input record {@code } can be transformed into output records {@code , , ...}. - * This is a stateful record-by-record operation (cf. {@link #flatMapValues(ValueMapperWithKey) flatMapValues()}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #flatMapValues(ValueMapperWithKey) flatMapValues()}). + * If you choose not to attach one, this operation is similar to the stateless {@link #flatMapValues(ValueMapperWithKey) flatMapValues()} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress can * be observed and additional periodic actions can be performed. *

@@ -1908,7 +1939,10 @@ public interface KStream { /** * Process all records in this stream, one record at a time, by applying a {@link Processor} (provided by the given * {@link ProcessorSupplier}). - * This is a stateful record-by-record operation (cf. {@link #foreach(ForeachAction)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #foreach(ForeachAction)}). + * If you choose not to attach one, this operation is similar to the stateless {@link #foreach(ForeachAction)} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. * Note that this is a terminal operation that returns void. @@ -1967,7 +2001,10 @@ public interface KStream { /** * Process all records in this stream, one record at a time, by applying a {@link Processor} (provided by the given * {@link ProcessorSupplier}). - * This is a stateful record-by-record operation (cf. {@link #foreach(ForeachAction)}). + * Attaching a state store makes this a stateful record-by-record operation (cf. {@link #foreach(ForeachAction)}). + * If you choose not to attach one, this operation is similar to the stateless {@link #foreach(ForeachAction)} + * but allows access to the {@code ProcessorContext} and record metadata. + * This is essentially mixing the Processor API into the DSL, and provides all the functionality of the PAPI. * Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress * can be observed and additional periodic actions can be performed. * Note that this is a terminal operation that returns void.