masteryhx commented on code in PR #24651: URL: https://github.com/apache/flink/pull/24651#discussion_r1565293565
########## flink-runtime/src/main/java/org/apache/flink/runtime/state/v2/StateDescriptor.java: ########## @@ -0,0 +1,167 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.state.v2; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.api.common.serialization.SerializerConfig; +import org.apache.flink.api.common.serialization.SerializerConfigImpl; +import org.apache.flink.api.common.state.StateTtlConfig; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.common.typeutils.TypeSerializer; +import org.apache.flink.util.Preconditions; + +import javax.annotation.Nonnull; + +import java.io.Serializable; + +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** + * Base class for state descriptors. A {@code StateDescriptor} is used for creating partitioned + * State in stateful operations internally. + * + * @param <T> The type of the value of the state object described by this state descriptor. + */ +@Internal +public abstract class StateDescriptor<T> implements Serializable { + + private static final long serialVersionUID = 1L; + + /** An enumeration of the types of supported states. */ + public enum Type { + VALUE, + LIST, + REDUCING, + FOLDING, + AGGREGATING, + MAP + } + + /** ID that uniquely identifies state created from this StateDescriptor. */ + @Nonnull private final String stateId; + + /** The serializer for the type. */ + @Nonnull private final TypeSerializer<T> typeSerializer; + + /** + * The type information describing the value type. Remain this since it could provide more + * information which could be used internally in the future. + */ + @Nonnull private final TypeInformation<T> typeInfo; Review Comment: Seems it's a bit confusing here so I just removed it currently. Let's add it if needed in the future. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org