-
Notifications
You must be signed in to change notification settings - Fork 458
feat(kv): enhance namespaced key-value store operations and handlers #2613
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?
Conversation
…rolManager initialization
…d read/write tests
…and update response handling
Missing modification of KVImage |
* @param keyAndNamespace key and namespace. | ||
* @return async get result. {@link ValueAndEpoch} value and epoch, null if key not exist. | ||
*/ | ||
CompletableFuture<ValueAndEpoch> getNamespacedKV(KeyAndNamespace keyAndNamespace); |
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.
Could we modify the Key with additional namespace field instead of create a new class
this.epoch = 0L; | ||
} | ||
|
||
public KeyValue(Key key, Value value, String namespace, long epoch) { |
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.
Add the doc for epoch field
@@ -47,30 +50,54 @@ public class KVControlManager { | |||
private final SnapshotRegistry registry; | |||
private final Logger log; | |||
private final TimelineHashMap<String, ByteBuffer> kv; | |||
private final TimelineHashMap<String, KeyMetadata> keyMetadataMap; |
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.
Maybe we don't need keyMetadata. We could just assign a special namespace&epoch to the old KV.
* @param options | ||
* @return | ||
*/ | ||
PutNamespacedKVResult putNamespacedKV( |
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.
Why does the parameter "partitions" exist?
@@ -4866,6 +4877,86 @@ public UpdateGroupResult updateGroup(String groupId, UpdateGroupSpec groupSpec, | |||
return new UpdateGroupResult(future.get(CoordinatorKey.byGroupId(groupId))); | |||
} | |||
|
|||
@Override |
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.
Please add AutoMQ extended code in the last of file and wrap the code with AutoMQ inject start / end.
@@ -0,0 +1,23 @@ | |||
package org.apache.kafka.clients.admin; |
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.
Add Apache License header
"name": "Epoch", | ||
"type": "int64", | ||
"versions": "1+", | ||
"about": "Epoch" |
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.
Add more description
.setEpoch(currentEpoch)); | ||
} | ||
|
||
long newEpoch = System.currentTimeMillis(); |
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.
We should use a incremental epoch
More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.
Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.
Committer Checklist (excluded from commit message)