StateStoreWriter Contract — Stateful Physical Operators That Write to StateStore
StateStoreWriter is the extension of the StatefulOperator Contract for physical operators that write to a state store and collect the write metrics for execution progress reporting.
| Key | Name (in web UI) | Description |
|---|---|---|
|
|
number of output rows |
|
|
|
number of total state rows |
|
|
|
number of updated state rows |
|
|
|
total time to update rows |
|
|
|
total time to remove rows |
|
|
|
time to commit changes |
|
|
|
memory used by state |
| StateStoreWriter | Description |
|---|---|
Setting StateStore-Specific Metrics for Stateful Physical Operator — setStoreMetrics Method
|
1 2 3 4 5 |
setStoreMetrics(store: StateStore): Unit |
setStoreMetrics requests store for metrics to use them to record the following metrics of a physical operator:
-
numTotalStateRowsasStateStore.numKeys -
stateMemoryasStateStore.memoryUsedBytes
setStoreMetrics records the implementation-specific metrics.
|
Note
|
|
getProgress Method
|
1 2 3 4 5 |
getProgress(): StateOperatorProgress |
getProgress…FIXME
|
Note
|
getProgress is used exclusively when ProgressReporter is requested to extractStateOperatorMetrics (when MicroBatchExecution is requested to run the activated streaming query).
|
shouldRunAnotherBatch Method
|
1 2 3 4 5 |
shouldRunAnotherBatch(newMetadata: OffsetSeqMetadata): Boolean |
shouldRunAnotherBatch is disabled by default.
|
Note
|
shouldRunAnotherBatch is used exclusively when IncrementalExecution is requested to shouldRunAnotherBatch (when MicroBatchExecution is requested to run the activated streaming query).
|
stateStoreCustomMetrics Internal Method
|
1 2 3 4 5 |
stateStoreCustomMetrics: Map[String, SQLMetric] |
stateStoreCustomMetrics…FIXME
|
Note
|
stateStoreCustomMetrics is used when StateStoreWriter is requested for the metrics and getProgress.
|
spark技术分享