trait StatefulProcessorHandle extends Serializable
Represents the operation handle provided to the stateful processor used in the arbitrary state API v2.
- Annotations
- @Evolving()
- Alphabetic
- By Inheritance
- StatefulProcessorHandle
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def deleteIfExists(stateName: String): Unit
Function to delete and purge state variable if defined previously
Function to delete and purge state variable if defined previously
- stateName
\- name of the state variable
- abstract def deleteTimer(expiryTimestampMs: Long): Unit
Function to delete a processing/event time based timer for given implicit grouping key and provided timestamp
Function to delete a processing/event time based timer for given implicit grouping key and provided timestamp
- expiryTimestampMs
\- timer expiry timestamp in milliseconds
- abstract def getListState[T](stateName: String, ttlConfig: TTLConfig)(implicit arg0: Encoder[T]): ListState[T]
(Scala-specific) Function to create new or return existing list state variable of given type with ttl.
(Scala-specific) Function to create new or return existing list state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any values in listState which have expired after ttlDuration will not be returned on get() and will be eventually removed from the state. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor. Note that this API uses the implicit SQL encoder in Scala.- T
\- type of state variable
- stateName
\- name of the state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of ListState of type T that can be used to store state persistently
- abstract def getListState[T](stateName: String, valEncoder: Encoder[T], ttlConfig: TTLConfig): ListState[T]
Function to create new or return existing list state variable of given type with ttl.
Function to create new or return existing list state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any values in listState which have expired after ttlDuration will not be returned on get() and will be eventually removed from the state. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor.- T
\- type of state variable
- stateName
\- name of the state variable
- valEncoder
\- SQL encoder for state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of ListState of type T that can be used to store state persistently
- abstract def getMapState[K, V](stateName: String, ttlConfig: TTLConfig)(implicit arg0: Encoder[K], arg1: Encoder[V]): MapState[K, V]
(Scala-specific) Function to create new or return existing map state variable of given type with ttl.
(Scala-specific) Function to create new or return existing map state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any values in mapState which have expired after ttlDuration will not be returned on get() and will be eventually removed from the state. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor. Note that this API uses the implicit SQL encoder in Scala.- K
\- type of key for map state variable
- V
\- type of value for map state variable
- stateName
\- name of the state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of MapState of type [K,V] that can be used to store state persistently
- abstract def getMapState[K, V](stateName: String, userKeyEnc: Encoder[K], valEncoder: Encoder[V], ttlConfig: TTLConfig): MapState[K, V]
Function to create new or return existing map state variable of given type with ttl.
Function to create new or return existing map state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any values in mapState which have expired after ttlDuration will not returned on get() and will be eventually removed from the state. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor.- K
\- type of key for map state variable
- V
\- type of value for map state variable
- stateName
\- name of the state variable
- userKeyEnc
\- spark sql encoder for the map key
- valEncoder
\- SQL encoder for state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of MapState of type [K,V] that can be used to store state persistently
- abstract def getQueryInfo(): QueryInfo
Function to return query info for the current query
Function to return query info for the current query
- returns
- QueryInfo object with access to streaming query metadata
- abstract def getValueState[T](stateName: String, ttlConfig: TTLConfig)(implicit arg0: Encoder[T]): ValueState[T]
(Scala-specific) Function to create new or return existing single value state variable of given type with ttl.
(Scala-specific) Function to create new or return existing single value state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any state update resets the ttl to current processing time plus ttlDuration. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor. Note that this API uses the implicit SQL encoder in Scala.- T
\- type of state variable
- stateName
\- name of the state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of ValueState of type T that can be used to store state persistently
- abstract def getValueState[T](stateName: String, valEncoder: Encoder[T], ttlConfig: TTLConfig): ValueState[T]
Function to create new or return existing single value state variable of given type with ttl.
Function to create new or return existing single value state variable of given type with ttl. State values will not be returned past ttlDuration, and will be eventually removed from the state store. Any state update resets the ttl to current processing time plus ttlDuration. Users can use the helper method
TTLConfig.NONE
in Scala orTTLConfig.NONE()
in Java for the TTLConfig parameter to disable TTL for the state variable.The user must ensure to call this function only within the
init()
method of the StatefulProcessor.- T
\- type of state variable
- stateName
\- name of the state variable
- valEncoder
\- SQL encoder for state variable
- ttlConfig
\- the ttl configuration (time to live duration etc.)
- returns
\- instance of ValueState of type T that can be used to store state persistently
- abstract def listTimers(): Iterator[Long]
Function to list all the timers registered for given implicit grouping key Note: calling listTimers() within the
handleInputRows
method of the StatefulProcessor will return all the unprocessed registered timers, including the one being fired within the invocation ofhandleInputRows
.Function to list all the timers registered for given implicit grouping key Note: calling listTimers() within the
handleInputRows
method of the StatefulProcessor will return all the unprocessed registered timers, including the one being fired within the invocation ofhandleInputRows
.- returns
\- list of all the registered timers for given implicit grouping key
- abstract def registerTimer(expiryTimestampMs: Long): Unit
Function to register a processing/event time based timer for given implicit grouping key and provided timestamp
Function to register a processing/event time based timer for given implicit grouping key and provided timestamp
- expiryTimestampMs
\- timer expiry timestamp in milliseconds
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)