klion26 commented on a change in pull request #8122: [FLINK-12121] [State
Backends] Use composition instead of inheritance for the InternalKeyContext
logic in backend
URL: https://github.com/apache/flink/pull/8122#discussion_r273297590
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackend.java
##########
@@ -175,8 +173,8 @@ public void dispose() {
@Override
public void setCurrentKey(K newKey) {
notifyKeySelected(newKey);
- this.currentKey = newKey;
- this.currentKeyGroup =
KeyGroupRangeAssignment.assignToKeyGroup(newKey, numberOfKeyGroups);
+ this.keyContext.setCurrentKey(newKey);
Review comment:
`InternalKeyContext#setCurrentKeyGroupIndex()` is just called here(beside
`InternalKeyContext#setCurrentKey`), can we add a function
`setCurrentKeyAndGroup` in `InternalKeyContext` and remove this
`setCurrentKeyGroupIndex` method?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services