Class ValueStateDescriptor<T>

  • Type Parameters:
    T - The type of the values that the value state can hold.
    All Implemented Interfaces:
    Serializable

    @PublicEvolving
    public class ValueStateDescriptor<T>
    extends StateDescriptor<org.apache.flink.api.common.state.ValueState<T>,​T>
    StateDescriptor for ValueState. This can be used to create partitioned value state using RuntimeContext.getState(ValueStateDescriptor).

    If you don't use one of the constructors that set a default value the value that you get when reading a ValueState using ValueState.value() will be null.

    See Also:
    Serialized Form
    • Constructor Detail

      • ValueStateDescriptor

        @Deprecated
        public ValueStateDescriptor​(String name,
                                    Class<T> typeClass,
                                    T defaultValue)
        Deprecated.
        Use ValueStateDescriptor(String, Class) instead and manually manage the default value by checking whether the contents of the state is null.
        Creates a new ValueStateDescriptor with the given name, type, and default value.

        If this constructor fails (because it is not possible to describe the type via a class), consider using the ValueStateDescriptor(String, TypeInformation, Object) constructor.

        Parameters:
        name - The (unique) name for the state.
        typeClass - The type of the values in the state.
        defaultValue - The default value that will be set when requesting state without setting a value before.
      • ValueStateDescriptor

        @Deprecated
        public ValueStateDescriptor​(String name,
                                    TypeInformation<T> typeInfo,
                                    T defaultValue)
        Deprecated.
        Use ValueStateDescriptor(String, TypeInformation) instead and manually manage the default value by checking whether the contents of the state is null.
        Creates a new ValueStateDescriptor with the given name and default value.
        Parameters:
        name - The (unique) name for the state.
        typeInfo - The type of the values in the state.
        defaultValue - The default value that will be set when requesting state without setting a value before.
      • ValueStateDescriptor

        @Deprecated
        public ValueStateDescriptor​(String name,
                                    TypeSerializer<T> typeSerializer,
                                    T defaultValue)
        Deprecated.
        Use ValueStateDescriptor(String, TypeSerializer) instead and manually manage the default value by checking whether the contents of the state is null.
        Creates a new ValueStateDescriptor with the given name, default value, and the specific serializer.
        Parameters:
        name - The (unique) name for the state.
        typeSerializer - The type serializer of the values in the state.
        defaultValue - The default value that will be set when requesting state without setting a value before.
      • ValueStateDescriptor

        public ValueStateDescriptor​(String name,
                                    Class<T> typeClass)
        Creates a new ValueStateDescriptor with the given name and type

        If this constructor fails (because it is not possible to describe the type via a class), consider using the ValueStateDescriptor(String, TypeInformation) constructor.

        Parameters:
        name - The (unique) name for the state.
        typeClass - The type of the values in the state.
      • ValueStateDescriptor

        public ValueStateDescriptor​(String name,
                                    TypeInformation<T> typeInfo)
        Creates a new ValueStateDescriptor with the given name and type.
        Parameters:
        name - The (unique) name for the state.
        typeInfo - The type of the values in the state.
      • ValueStateDescriptor

        public ValueStateDescriptor​(String name,
                                    TypeSerializer<T> typeSerializer)
        Creates a new ValueStateDescriptor with the given name and the specific serializer.
        Parameters:
        name - The (unique) name for the state.
        typeSerializer - The type serializer of the values in the state.