tzulitai 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_r273795301
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/StateTable.java ########## @@ -52,13 +52,22 @@ protected RegisteredKeyValueStateBackendMetaInfo<N, S> metaInfo; /** - * - * @param keyContext the key context provides the key scope for all put/get/delete operations. - * @param metaInfo the meta information, including the type serializer for state copy-on-write. + * The serializer of the key. + */ + protected final TypeSerializer<K> keySerializer; + + /** + * @param keyContext the key context provides the key scope for all put/get/delete operations. + * @param metaInfo the meta information, including the type serializer for state copy-on-write. + * @param keySerializer the serializer of the key. */ - public StateTable(InternalKeyContext<K> keyContext, RegisteredKeyValueStateBackendMetaInfo<N, S> metaInfo) { + public StateTable( + InternalKeyContext<K> keyContext, + RegisteredKeyValueStateBackendMetaInfo<N, S> metaInfo, + TypeSerializer<K> keySerializer) { this.keyContext = Preconditions.checkNotNull(keyContext); this.metaInfo = Preconditions.checkNotNull(metaInfo); + this.keySerializer = keySerializer; Review comment: `this.keySerializer = Preconditions.checkNotNull(keySerializer)` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services