StreamingQueryManager
Defined in: streaming/streaming-query-manager.ts:36
Manages the streaming queries on a SparkSession. Obtained via
spark.streams. Mirrors pyspark.sql.streaming.StreamingQueryManager and
the canonical Scala StreamingQueryManager.
Spark source: StreamingQueryManager.scala
Methods
Section titled “Methods”active()
Section titled “active()”active(): Promise<StreamingQuery[]>;Defined in: streaming/streaming-query-manager.ts:45
All currently-active streaming queries on this session.
Returns
Section titled “Returns”Promise<StreamingQuery[]>
addListener()
Section titled “addListener()”addListener(listener): Promise<void>;Defined in: streaming/streaming-query-manager.ts:118
Register listener on the streaming-query event bus. The first call
opens a server-side subscription; subsequent listeners share it.
Resolves once the server acknowledges registration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener |
StreamingQueryListener |
Returns
Section titled “Returns”Promise<void>
Remarks
Section titled “Remarks”On a non-recoverable subscription drop the bus clears every
listener; the caller must addListener again to restart.
awaitAnyTermination()
Section titled “awaitAnyTermination()”awaitAnyTermination(timeoutMs?): Promise<boolean | undefined>;Defined in: streaming/streaming-query-manager.ts:88
Block until any streaming query on this session terminates.
- With
timeoutMs: returnstrueif a query terminated within the timeout,falseotherwise. - Without a timeout: blocks until something terminates, returns
undefined.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
timeoutMs? |
number |
Returns
Section titled “Returns”Promise<boolean | undefined>
Remarks
Section titled “Remarks”The timeout is in milliseconds, matching the Scala client and the
Spark Connect timeout_ms wire field. PySpark’s
awaitAnyTermination(timeout) takes seconds; pass 10_000 for the
PySpark 10 equivalent.
Throws
Section titled “Throws”SparkConnectError if a query terminated with an exception.
get(id): Promise< | StreamingQuery| null>;Defined in: streaming/streaming-query-manager.ts:57
Look up a running query by id (the persistent identifier, not runId).
Returns null when the server reports no matching query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<
| StreamingQuery
| null>
removeListener()
Section titled “removeListener()”removeListener(listener): Promise<void>;Defined in: streaming/streaming-query-manager.ts:132
Remove a previously-added listener. No-op if it isn’t registered. When the last listener is removed, tears down the subscription.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener |
StreamingQueryListener |
Returns
Section titled “Returns”Promise<void>
resetTerminated()
Section titled “resetTerminated()”resetTerminated(): Promise<void>;Defined in: streaming/streaming-query-manager.ts:106
Clear the “any query terminated” flag so the next call blocks again.
Returns
Section titled “Returns”Promise<void>