Tan-JiaLiang commented on code in PR #30:
URL:
https://github.com/apache/flink-connector-hbase/pull/30#discussion_r1381499570
##########
flink-connector-hbase-base/src/main/java/org/apache/flink/connector/hbase/sink/HBaseSinkFunction.java:
##########
@@ -256,4 +263,39 @@ public void
onException(RetriesExhaustedWithDetailsException exception, Buffered
// if the failure handler decides to throw an exception
failureThrowable.compareAndSet(null, exception);
}
+
+ /**
+ * Thread-safe class, grouped mutations by rows and keep the latest
mutation. For more info, see
+ * <a
href="https://issues.apache.org/jira/browse/HBASE-8626">HBASE-8626</a>.
+ */
+ private static class DeduplicatedMutator {
Review Comment:
Yes, I've thought about it. However, the `flush` need to call the `values`
and `clear` API of the map.
If thread A call `flush`, and then thread B call `mutate`, before the thread
A call `clear` in the `flush` method, the thread B may call the `put` API.
So maybe using the `ConcurrentHashMap` have the same problem?
--
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]