Class StateDescriptor<T>

    • Constructor Detail

      • StateDescriptor

        protected StateDescriptor​(@Nonnull
                                  String stateId,
                                  @Nonnull
                                  TypeInformation<T> typeInfo)
        Create a new StateDescriptor with the given stateId and the given type information.
        Parameters:
        stateId - The stateId of the StateDescriptor.
        typeInfo - The type information for the values in the state.
      • StateDescriptor

        protected StateDescriptor​(@Nonnull
                                  String stateId,
                                  TypeSerializer<T> serializer)
        Create a new StateDescriptor with the given stateId and the given type serializer.
        Parameters:
        stateId - The stateId of the StateDescriptor.
        serializer - The type serializer for the values in the state.
      • StateDescriptor

        protected StateDescriptor​(String name,
                                  Class<T> type)
        Create a new StateDescriptor with the given name and the given type information.

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

        Parameters:
        name - The name of the StateDescriptor.
        type - The class of the type of values in the state.
    • Method Detail

      • enableTimeToLive

        public void enableTimeToLive​(StateTtlConfig ttlConfig)
        Configures optional activation of state time-to-live (TTL).

        State user value will expire, become unavailable and be cleaned up in storage depending on configured StateTtlConfig.

        Parameters:
        ttlConfig - configuration of state TTL
      • getStateId

        @Nonnull
        public String getStateId()
      • getTypeInformation

        @Internal
        @Nullable
        public TypeInformation<T> getTypeInformation()
      • isSerializerInitialized

        public boolean isSerializerInitialized()
        Checks whether the serializer has been initialized. Serializer initialization is lazy, to allow parametrization of serializers with an ExecutionConfig via initializeSerializerUnlessSet(ExecutionConfig).
        Returns:
        True if the serializers have been initialized, false otherwise.
      • initializeSerializerUnlessSet

        public void initializeSerializerUnlessSet​(ExecutionConfig executionConfig)
        Initializes the serializer, unless it has been initialized before.
        Parameters:
        executionConfig - The execution config to use when creating the serializer.
      • initializeSerializerUnlessSet

        @Internal
        public void initializeSerializerUnlessSet​(SerializerFactory serializerFactory)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getType

        @Internal
        public abstract StateDescriptor.Type getType()
        Return the specific Type of described state.