Tan-JiaLiang commented on code in PR #30:
URL:
https://github.com/apache/flink-connector-hbase/pull/30#discussion_r1381181977
##########
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:
Sorry for breaking our previous agreement. The reason for using
`synchronized` is that `HBaseSinkFunction` has a timer task to periodically
call the `flush` API, which makes the `DeduplicatedMutator#mutations` (the map
for deduplication) has a potentially thread-safe 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]