关注 spark技术分享,
撸spark源码 玩spark最佳实践

StateStoreHandler Internal Contract

StateStoreHandler Internal Contract

StateStoreHandler is the internal base of state store handlers that manage a StateStore (i.e. commit, abortIfNeeded and metrics).

StateStoreHandler takes a single StateStoreType to be created:

Note
StateStoreHandler is a Scala private abstract class and cannot be created directly. It is created indirectly for the concrete StateStoreHandlers.
Table 1. StateStoreHandler Contract
Method Description

stateStore

When requested for the StateStoreMetrics, StateStoreHandler simply requests the StateStore for them.

Table 2. StateStoreHandlers
StateStoreHandler Description

KeyToNumValuesStore

KeyWithIndexToValueStore

StateStoreHandler takes a single StateStoreType when created.

Note
StateStoreHandler is a Scala abstract class and cannot be created directly. It is created indirectly when the concrete StateStoreHandlers are.
Tip

Enable DEBUG or INFO logging levels for org.apache.spark.sql.execution.streaming.state.SymmetricHashJoinStateManager.StateStoreHandler logger to see what happens inside.

Add the following line to conf/log4j.properties:

Refer to Logging.

Committing Changes to State Store — commit Method

commit…​FIXME

Note
commit is used when…​FIXME

abortIfNeeded Method

abortIfNeeded…​FIXME

Note
abortIfNeeded is used when…​FIXME

getStateStore Method

getStateStore…​FIXME

Note
getStateStore is used when KeyToNumValuesStore and KeyWithIndexToValueStore are created.

StateStoreType Contract (Sealed Trait)

StateStoreType is required to create a StateStoreHandler.

Table 3. StateStoreTypes
StateStoreType toString Description

KeyToNumValuesType

keyToNumValues

KeyWithIndexToValueType

keyWithIndexToValue

Note
StateStoreType is a Scala private sealed trait which means that all the implementations are in the same compilation unit (a single file).
赞(0) 打赏
未经允许不得转载:spark技术分享 » StateStoreHandler Internal Contract
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏