Skip to content

Commit 6ec6e33

Browse files
fix thread-safety problem of PrimaryKeyLoookuper and PrefixKeyLookuper
1 parent fcd2378 commit 6ec6e33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fluss-client/src/main/java/org/apache/fluss/client/lookup/PrefixKeyLookuper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private void validatePrefixLookup(TableInfo tableInfo, List<String> lookupColumn
146146
}
147147

148148
@Override
149-
public CompletableFuture<LookupResult> lookup(InternalRow prefixKey) {
149+
public synchronized CompletableFuture<LookupResult> lookup(InternalRow prefixKey) {
150150
byte[] bucketKeyBytes = bucketKeyEncoder.encodeKey(prefixKey);
151151
int bucketId = bucketingFunction.bucketing(bucketKeyBytes, numBuckets);
152152

fluss-client/src/main/java/org/apache/fluss/client/lookup/PrimaryKeyLookuper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public PrimaryKeyLookuper(
101101
}
102102

103103
@Override
104-
public CompletableFuture<LookupResult> lookup(InternalRow lookupKey) {
104+
public synchronized CompletableFuture<LookupResult> lookup(InternalRow lookupKey) {
105105
// encoding the key row using a compacted way consisted with how the key is encoded when put
106106
// a row
107107
byte[] pkBytes = primaryKeyEncoder.encodeKey(lookupKey);

0 commit comments

Comments
 (0)