-
Notifications
You must be signed in to change notification settings - Fork 622
[server][client] Support per-partition bucket count for partitioned tables #3908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
917013c
bf61c55
c223a7e
a26a06b
8ad6c43
687d036
dc2028d
ae15934
8f1f1fd
9c79417
3316d3b
d7ae991
bec161c
3a3a0c3
0e99fff
c60e5b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,15 +41,25 @@ public class LookupQuery extends AbstractLookupQuery<byte[]> { | |
| TableBucket tableBucket, | ||
| byte[] key, | ||
| boolean insertIfNotExists, | ||
| @Nullable String originalPartitionName) { | ||
| super(tablePath, tableBucket, key, originalPartitionName); | ||
| @Nullable String originalPartitionName, | ||
| int bucketCount) { | ||
| super(tablePath, tableBucket, key, originalPartitionName, bucketCount); | ||
| this.future = new CompletableFuture<>(); | ||
| this.insertIfNotExists = insertIfNotExists; | ||
| } | ||
|
|
||
| LookupQuery( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
| TablePath tablePath, | ||
| TableBucket tableBucket, | ||
| byte[] key, | ||
| boolean insertIfNotExists, | ||
| @Nullable String originalPartitionName) { | ||
| this(tablePath, tableBucket, key, insertIfNotExists, originalPartitionName, 0); | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
| LookupQuery(TablePath tablePath, TableBucket tableBucket, byte[] key) { | ||
| this(tablePath, tableBucket, key, false, null); | ||
| this(tablePath, tableBucket, key, false, null, 0); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
| import org.apache.fluss.rpc.messages.PrefixLookupRequest; | ||
| import org.apache.fluss.rpc.messages.PrefixLookupResponse; | ||
| import org.apache.fluss.rpc.protocol.ApiError; | ||
| import org.apache.fluss.rpc.protocol.Errors; | ||
| import org.apache.fluss.utils.ExponentialBackoff; | ||
| import org.apache.fluss.utils.types.Tuple2; | ||
|
|
||
|
|
@@ -221,7 +222,7 @@ private void sendLookupRequest( | |
| LookupBatchKey batchKey = new LookupBatchKey(tb, lookup.originalPartitionName()); | ||
| lookupByTableId | ||
| .computeIfAbsent(tableId, k -> new LinkedHashMap<>()) | ||
| .computeIfAbsent(batchKey, k -> new LookupBatch(batchKey)) | ||
| .computeIfAbsent(batchKey, k -> new LookupBatch(batchKey, lookup.bucketCount())) | ||
| .addLookup(lookup); | ||
| } | ||
|
|
||
|
|
@@ -299,7 +300,7 @@ private void sendPrefixLookupRequest( | |
| long tableId = tb.getTableId(); | ||
| lookupByTableId | ||
| .computeIfAbsent(tableId, k -> new HashMap<>()) | ||
| .computeIfAbsent(tb, k -> new PrefixLookupBatch(tb)) | ||
| .computeIfAbsent(tb, k -> new PrefixLookupBatch(tb, prefixLookup.bucketCount())) | ||
| .addLookup(prefixLookup); | ||
| } | ||
|
|
||
|
|
@@ -565,6 +566,13 @@ private void handleLookupError( | |
| invalidTableOrPartitions(tableOrPartitions); | ||
| } | ||
|
|
||
| if (error.error() == Errors.STALE_METADATA) { | ||
| for (AbstractLookupQuery<?> lookup : lookups) { | ||
| lookup.future().completeExceptionally(exception); | ||
| } | ||
| return; | ||
| } | ||
|
Comment on lines
+569
to
+574
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to specially handling |
||
|
|
||
| for (AbstractLookupQuery<?> lookup : lookups) { | ||
| String originalPartitionNameMsg = | ||
| lookup.originalPartitionName() == null | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can simplify this 2 foreach into 1 foreach and simplify the logic.