xinyuiscool commented on a change in pull request #1579:
URL: https://github.com/apache/samza/pull/1579#discussion_r796155522
##########
File path: docs/learn/documentation/versioned/api/high-level-api.md
##########
@@ -260,6 +260,25 @@ Sends all messages in this MessageStream to the provided
Table. The expected mes
{% endhighlight %}
+Sends all update messages in this MessageStream to the provided Table. The
expected message type is [KV](javadocs/org/apache/samza/operators/KV).
+V should be on type UpdateMessage which defines an update message and an
optional default to be inserted in the absence of an existing record.
+User also needs to pass an UpdateOptions parameter as well in the sendTo call
of MessageStream. It defines the behavior of the sendTo-table operator
+in terms of whether it should insert a default in the absence of an existing
record or not.
+
+{% highlight java %}
+
+ MessageStream<Profile> profilesStream = ...
+ Table<KV<Long, UpdateMessage<Profile, String>>> profilesTable =
Review comment:
A couple of issue with this example: first we are not allowed to use
word "member" "profile" in open source code. These are li terminologies. Please
replace with common words, like Event, User, etc.
secondly, should the table type still be Table<KV<Long, Profile>>? The table
def seems won't need this update type.
Last, from the sendTo api, seems the map() in the code should map from
profile to a KV of <Integer, UpdateMessage>, not KV<Integer, String>
<K, V, U> MessageStream<KV<K, UpdateMessage<U, V>>> sendTo(Table<KV<K, V>>
table, UpdateOptions updateOptions);
--
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]