ferenc-csaky commented on code in PR #30:
URL:
https://github.com/apache/flink-connector-hbase/pull/30#discussion_r1381475790
##########
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:
I gave it another thought and I shaped my opinion a bit.
The previous code handled `BufferedMutator` thread-safe, so I think we can
continue to keep that assumption. This means in`DeduplicatedMutator` we only
need to keep an eye on the `mutations` map. So instead of synchronizing all
methods I suggest to use a `ConcurrentHashMap` instead of `HashMap`.
WDYT?
--
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]