liming30 commented on code in PR #3297:
URL: https://github.com/apache/paimon/pull/3297#discussion_r1591892532
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/PrimaryKeyLookupTable.java:
##########
@@ -99,25 +99,35 @@ public void refresh(Iterator<InternalRow> incremental)
throws IOException {
Predicate predicate = projectedPredicate();
while (incremental.hasNext()) {
InternalRow row = incremental.next();
- primaryKeyRow.replaceRow(row);
- if (userDefinedSeqComparator != null) {
- InternalRow previous = tableState.get(primaryKeyRow);
- if (previous != null &&
userDefinedSeqComparator.compare(previous, row) > 0) {
- continue;
+ if (refreshAsync) {
Review Comment:
If this is a common piece of code, I think it could be implemented in
`FullCacheLookupTable` and then provide an abstract `refreshRow` interface to
subclasses.
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/PrimaryKeyLookupTable.java:
##########
@@ -99,25 +99,35 @@ public void refresh(Iterator<InternalRow> incremental)
throws IOException {
Predicate predicate = projectedPredicate();
while (incremental.hasNext()) {
InternalRow row = incremental.next();
- primaryKeyRow.replaceRow(row);
- if (userDefinedSeqComparator != null) {
- InternalRow previous = tableState.get(primaryKeyRow);
- if (previous != null &&
userDefinedSeqComparator.compare(previous, row) > 0) {
- continue;
+ if (refreshAsync) {
+ synchronized (lock) {
Review Comment:
Is it possible to achieve thread safety in `RocksDBState`, it looks like
only the inconsistency may occur when updating the `cache`.
--
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]