Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5691#discussion_r175640731
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/internal/InternalQueryableKvState.java
 ---
    @@ -16,46 +16,42 @@
      * limitations under the License.
      */
     
    -package org.apache.flink.runtime.query;
    +package org.apache.flink.runtime.state.internal;
     
    -import org.apache.flink.annotation.Internal;
     import org.apache.flink.annotation.VisibleForTesting;
    -import org.apache.flink.runtime.state.internal.InternalKvState;
    +import org.apache.flink.api.common.typeutils.TypeSerializer;
    +import org.apache.flink.runtime.query.KvStateInfo;
     import org.apache.flink.util.Preconditions;
     
     import java.util.concurrent.ConcurrentHashMap;
     import java.util.concurrent.ConcurrentMap;
     
     /**
    - * An entry holding the {@link InternalKvState} along with its {@link 
KvStateInfo}.
    + * An abstract base class to be subclassed by states that are expected to 
be queryable.
    + * Its main task is to keep a "thread-local" copy of the different 
serializers (if needed).
      *
      * @param <K>      The type of key the state is associated to
      * @param <N>      The type of the namespace the state is associated to
      * @param <V>      The type of values kept internally in state
      */
    -@Internal
    -public class KvStateEntry<K, N, V> {
    +public abstract class InternalQueryableKvState<K, N, V> implements 
InternalKvState<N> {
     
    -   private final InternalKvState<K, N, V> state;
        private final KvStateInfo<K, N, V> stateInfo;
    -
        private final boolean areSerializersStateless;
     
    -   private final ConcurrentMap<Thread, KvStateInfo<K, N, V>> 
serializerCache;
    +   private final ConcurrentMap<Thread, KvStateInfo<K, N, V>> 
serializerCache = new ConcurrentHashMap<>(4);
     
    --- End diff --
    
    nit:  just wonder why didn't use ThreadLocal<KvStateInfo<K, N, V>> provided 
by JDK...


---

Reply via email to