dengpanyin commented on a change in pull request #991: [SAMZA-2162] - Update
Table APIs to be consistent with High level Async API
URL: https://github.com/apache/samza/pull/991#discussion_r276482359
##########
File path:
samza-core/src/main/java/org/apache/samza/operators/impl/SendToTableOperatorImpl.java
##########
@@ -56,9 +55,9 @@ protected void handleInit(Context context) {
@Override
protected CompletionStage<Collection<Void>> handleMessageAsync(KV<K, V>
message, MessageCollector collector,
TaskCoordinator coordinator) {
- table.put(message.getKey(), message.getValue());
// there should be no further chained operators since this is a terminal
operator.
- return CompletableFuture.completedFuture(Collections.emptyList());
+ return table.putAsync(message.getKey(), message.getValue())
Review comment:
with this change, the put order is not guaranteed any more.
Let's say a sequence of put event:
1. put(1, 10)
2. put (2, 20)
3. put(1, 5)
The 1st put fails at the 1st attempt and retry triggered.
2nd put succeed
3rd put succeed
then the retry for the 1st put succeeds.
Now the value for key 1 in the store is 10, while 5 is expected.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services