apply(
stateInfo: StatefulOperatorStateInfo,
partitionIndex: Int,
storeName: String): StateStoreProviderId
StateStoreProviderId — Unique Identifier of State Store Provider
StateStoreProviderId
is a unique identifier of a state store provider with the following properties:
-
Run ID of a streaming query (java.util.UUID)
In other words, StateStoreProviderId
is a StateStoreId with the run ID that is different every restart.
StateStoreProviderId
is used by the following execution components:
-
StateStoreCoordinator
to track the executors of state store providers (on the driver) -
StateStore
object to manage state store providers (on executors)
-
StateStoreRDD
is requested for the placement preferences of a partition and to compute a partition -
StateStoreAwareZipPartitionsRDD
is requested for the preferred locations of a partition -
StateStoreHandler
is requested to look up a state store
Creating StateStoreProviderId — apply
Factory Method
apply
simply creates a new StateStoreProviderId for the StatefulOperatorStateInfo, the partition and the store name.
Internally, apply
requests the StatefulOperatorStateInfo
for the checkpoint directory (aka checkpointLocation) and the stateful operator ID and creates a new StateStoreId (with the partitionIndex
and storeName
).
In the end, apply
requests the StatefulOperatorStateInfo
for the run ID of a streaming query and creates a new StateStoreProviderId (together with the run ID).
Note
|
|