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:
-
StateStoreCoordinatorto track the executors of state store providers (on the driver) -
StateStoreobject to manage state store providers (on executors)
-
StateStoreRDDis requested for the placement preferences of a partition and to compute a partition -
StateStoreAwareZipPartitionsRDDis requested for the preferred locations of a partition -
StateStoreHandleris 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
|
|