Packages

c

org.apache.spark.sql.execution.streaming.runtime

MicroBatchExecutionContext

class MicroBatchExecutionContext extends StreamExecutionContext with Logging

Holds the all the mutable state and processing metrics for a single micro-batch when using micro batch execution mode.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MicroBatchExecutionContext
  2. StreamExecutionContext
  3. ProgressContext
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MicroBatchExecutionContext(id: UUID, runId: UUID, name: String, triggerClock: Clock, sources: Seq[SparkDataStream], sink: Table, progressReporter: ProgressReporter, _batchId: Long, sparkSession: SparkSession, previousContext: Option[MicroBatchExecutionContext])

    _batchId

    the id of this batch

    previousContext

    the execution context of the previous micro-batch

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def MDC(key: LogKey, value: Any): MDC
    Attributes
    protected
    Definition Classes
    Logging
  5. var _batchId: Long
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. var batchId: Long
    Definition Classes
    StreamExecutionContext
  8. def carryOverExecStatsOnLatestExecutedBatch(): Unit
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  10. var currentStatus: StreamingQueryStatus
    Definition Classes
    ProgressContext
  11. var currentTriggerStartTimestamp: Long
    Attributes
    protected
    Definition Classes
    ProgressContext
  12. var endOffsets: StreamProgress

    Stores the end offsets for this batch.

    Stores the end offsets for this batch. Only the scheduler thread should modify this field, and only in atomic steps. Other threads should make a shallow copy if they are going to access this field more than once, since the field's value may change at any time.

    Definition Classes
    StreamExecutionContext
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. var execStatsOnLatestExecutedBatch: Option[ExecutionStats]
    Attributes
    protected
    Definition Classes
    ProgressContext
  16. var executionPlan: IncrementalExecution
    Definition Classes
    StreamExecutionContext
  17. def finishNoExecutionTrigger(lastExecutedEpochId: Long): Unit

    Finalizes the trigger which did not execute a batch.

    Finalizes the trigger which did not execute a batch.

    Definition Classes
    ProgressContext
  18. def finishTrigger(hasNewData: Boolean, lastExecution: IncrementalExecution, lastEpoch: Long): Unit

    Override of finishTrigger to extract the map from IncrementalExecution.

    Override of finishTrigger to extract the map from IncrementalExecution.

    Definition Classes
    ProgressContext
  19. def finishTrigger(hasNewData: Boolean, sourceToNumInputRowsMap: Map[SparkDataStream, Long], lastExecution: IncrementalExecution, lastEpochId: Long): Unit

    Finalizes the query progress and adds it to list of recent status updates.

    Finalizes the query progress and adds it to list of recent status updates.

    hasNewData

    Whether the sources of this stream had new data for this trigger.

    Definition Classes
    ProgressContext
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. def getDuration(key: String): Option[Long]

    Retrieve a measured duration

    Retrieve a measured duration

    Definition Classes
    ProgressContext
  22. def getNextContext(): MicroBatchExecutionContext
  23. def getStartTime(): Long
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  25. val id: UUID
    Definition Classes
    StreamExecutionContext
  26. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  27. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. var isCurrentBatchConstructed: Boolean

    Signifies whether current batch (i.e.

    Signifies whether current batch (i.e. for the batch currentBatchId) has been constructed (i.e. written to the offsetLog) and is ready for execution.

  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  31. var lastTriggerStartTimestamp: Long
    Attributes
    protected
    Definition Classes
    ProgressContext
  32. var latestOffsets: StreamProgress

    Tracks the latest offsets for each input source.

    Tracks the latest offsets for each input source. Only the scheduler thread should modify this field, and only in atomic steps. Other threads should make a shallow copy if they are going to access this field more than once, since the field's value may change at any time.

    Definition Classes
    StreamExecutionContext
  33. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  34. def logBasedOnLevel(level: Level)(f: => MessageWithContext): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  42. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  44. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  47. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  48. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  49. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  50. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  52. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  54. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  55. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  56. var metricWarningLogged: Boolean

    Flag that signals whether any error with input metrics have already been logged

    Flag that signals whether any error with input metrics have already been logged

    Attributes
    protected
    Definition Classes
    ProgressContext
  57. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  58. var newData: Map[SparkDataStream, LogicalPlan]

    Holds the most recent input data for each source.

    Holds the most recent input data for each source.

    Definition Classes
    StreamExecutionContextProgressContext
  59. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  60. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  61. var offsetSeqMetadata: OffsetSeqMetadata

    Metadata associated with the offset seq of a batch in the query.

    Metadata associated with the offset seq of a batch in the query.

    Definition Classes
    StreamExecutionContextProgressContext
  62. def onExecutionComplete(): Unit
  63. def onExecutionFailure(): Unit
  64. var previousContext: Option[MicroBatchExecutionContext]
  65. def recordEndOffsets(to: StreamProgress): Unit

    Only used by Real-time Mode.

    Only used by Real-time Mode. For other cases, end offsets are determined in the batch planning phase so it is never need to be updated.

    Definition Classes
    ProgressContext
  66. def recordTriggerOffsets(from: StreamProgress, to: StreamProgress, latest: StreamProgress): Unit

    Record the offsets range this trigger will process.

    Record the offsets range this trigger will process. Call this before updating committedOffsets in StreamExecution to make sure that the correct range is recorded.

    Definition Classes
    ProgressContext
  67. def reportTimeTaken(triggerDetailKey: String, timeTakenMs: Long): Unit

    Reports an input duration for a particular detail key in the next query progress update.

    Reports an input duration for a particular detail key in the next query progress update. Can be used directly instead of reportTimeTaken(key)(body) when the duration is measured asynchronously.

    Definition Classes
    ProgressContext
  68. def reportTimeTaken[T](triggerDetailKey: String)(body: => T): T

    Records the duration of running body for the next query progress update.

    Records the duration of running body for the next query progress update.

    Definition Classes
    ProgressContext
  69. var sinkCommitProgress: Option[StreamWriterCommitProgress]
    Definition Classes
    ProgressContext
  70. var startOffsets: StreamProgress

    Stores the start offset for this batch.

    Stores the start offset for this batch. Only the scheduler thread should modify this field, and only in atomic steps. Other threads should make a shallow copy if they are going to access this field more than once, since the field's value may change at any time.

    Definition Classes
    StreamExecutionContext
  71. def startTrigger(): Unit

    Begins recording statistics about query progress for a given trigger.

    Begins recording statistics about query progress for a given trigger.

    Definition Classes
    MicroBatchExecutionContextProgressContext
  72. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  73. def toString(): String
    Definition Classes
    MicroBatchExecutionContext → AnyRef → Any
  74. def updateStatusMessage(message: String): Unit

    Updates the message returned in status.

    Updates the message returned in status.

    Definition Classes
    ProgressContext
  75. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  76. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  77. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  78. def withLogContext(context: Map[String, String])(body: => Unit): Unit
    Attributes
    protected
    Definition Classes
    Logging

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from StreamExecutionContext

Inherited from ProgressContext

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped