muralibasani commented on code in PR #22221:
URL: https://github.com/apache/kafka/pull/22221#discussion_r3213782942


##########
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java:
##########
@@ -526,6 +526,21 @@ <VOut> KStream<K, VOut> flatMapValues(final 
ValueMapperWithKey<? super K, ? supe
      */
     KStream<K, V> repartition(final Repartitioned<K, V> repartitioned);
 
+    /**
+     * Mark the {@code KStream} as partitioned to signal the stream is 
partitioned as intended,
+     * and does not require further repartitioning in downstream for preceding 
key-changing operations.
+     *
+     * <p><em>
+     *     Note that {@link KStream#markAsPartitioned()} SHOULD NOT be used 
with interactive query(IQ) or {@link KStream#join}.
+     *     For reasons that when repartitions happen, records are physically 
shuffled by a composite key defined in the stateful operation.
+     *     However, if the repartitions were cancelled, records stayed in 
their original partition by its original key. IQ or joins
+     *     assumes and uses the composite key instead of the original key.
+     * </p></em>
+     *
+     * @return a new, mutated {@code KStream} that will not repartition in 
subsequent operations.
+     */
+    KStream<K, V> markAsPartitioned();

Review Comment:
   Not sure if KStream.scala should also be updated with this ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to