Updated javadocs for aggregate and reduce methods returning null behavior.
This is an update to the existing javadocs for KGroupedStream class.
Guozhang Wang Matthias J. Sax  John Roesler Bill Bejeck
@@ -146,7 +146,9 @@ public interface KGroupedStream<K, V> {
*
* @param reducer a {@link Reducer} that computes a new aggregate result. Cannot be {@code null}.
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
- * latest (rolling) aggregate for each key
+ * latest (rolling) aggregate for each key. If the reduce function returns {@code null}, it is then interpreted as
+ * deletion for the key, and future messages of the same key coming from upstream operators
+ * will be handled as newly initialized value.
*/
KTable<K, V> reduce(final Reducer<V> reducer);
@@ -208,7 +210,9 @@ public interface KGroupedStream<K, V> {
* @param reducer a {@link Reducer} that computes a new aggregate result. Cannot be {@code null}.
* @param materialized an instance of {@link Materialized} used to materialize a state store. Cannot be {@code null}.
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
- * latest (rolling) aggregate for each key
+ * latest (rolling) aggregate for each key. If the reduce function returns {@code null}, it is then interpreted as
+ * deletion for the key, and future messages of the same key coming from upstream operators
+ * will be handled as newly initialized value.
*/
KTable<K, V> reduce(final Reducer<V> reducer,
final Materialized<K, V, KeyValueStore<Bytes, byte[]>> materialized);
@@ -251,7 +255,9 @@ public interface KGroupedStream<K, V> {
* @param aggregator an {@link Aggregator} that computes a new aggregate result
* @param <VR> the value type of the resulting {@link KTable}
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
- * latest (rolling) aggregate for each key
+ * latest (rolling) aggregate for each key. If the aggregate function returns {@code null}, it is then interpreted as
+ * deletion for the key, and future messages of the same key coming from upstream operators
+ * will be handled as newly initialized value.
*/
<VR> KTable<K, VR> aggregate(final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator);
@@ -308,7 +314,9 @@ public interface KGroupedStream<K, V> {
* @param materialized an instance of {@link Materialized} used to materialize a state store. Cannot be {@code null}.
* @param <VR> the value type of the resulting {@link KTable}
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
- * latest (rolling) aggregate for each key
+ * latest (rolling) aggregate for each key. If the aggregate function returns {@code null}, it is then interpreted as
+ * deletion for the key, and future messages of the same key coming from upstream operators
+ * will be handled as newly initialized value.
*/
<VR> KTable<K, VR> aggregate(final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
