-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49249][SPARK-49320] Add new tag-related APIs in Connect back to Spark Core #47815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e93cedd
694db1b
40610a7
a70d7d2
0656e25
6b6ca7f
d3cd5f5
0922dd2
2a6fcc6
ef0fddf
f2ad163
ab00685
dd10f46
bc9b76d
8656810
1dfafad
1d4d5cc
a35c4e5
d1208c4
13342cf
3879989
cf6437f
4d7da3b
b3b7cbc
7c9294e
7338b1d
905bf91
514b5e4
c6fb41f
2a0292c
2d059b3
a55c47c
e66ba0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -885,7 +885,7 @@ class SparkSession private( | |
| * @since 4.0.0 | ||
| */ | ||
| def interruptAll(): Seq[String] = | ||
| doInterruptTag(sessionJobTag, "as part of cancellation of all jobs", tagIsInternal = true) | ||
| doInterruptTag(sessionJobTag, "as part of cancellation of all jobs") | ||
|
|
||
| /** | ||
| * Request to interrupt all currently running operations of this session with the given job tag. | ||
|
|
@@ -897,16 +897,12 @@ class SparkSession private( | |
| def interruptTag(tag: String): Seq[String] = { | ||
| val realTag = managedJobTags.get(tag) | ||
| if (realTag == null) return Seq.empty | ||
| doInterruptTag(realTag, s"part of cancelled job tags $tag", tagIsInternal = false) | ||
| doInterruptTag(realTag, s"part of cancelled job tags $tag") | ||
| } | ||
|
|
||
| private def doInterruptTag( | ||
| tag: String, | ||
| reason: String, | ||
| tagIsInternal: Boolean): Seq[String] = { | ||
| val realTag = if (tagIsInternal) s"${SparkContext.SPARK_JOB_TAGS_INTERNAL_PREFIX}$tag" else tag | ||
| private def doInterruptTag(tag: String, reason: String): Seq[String] = { | ||
| val cancelledTags = | ||
| sparkContext.cancelJobsWithTagWithFuture(realTag, reason) | ||
| sparkContext.cancelJobsWithTagWithFuture(tag, reason) | ||
|
|
||
| ThreadUtils.awaitResult(cancelledTags, 60.seconds) | ||
| .flatMap(job => Option(job.properties.getProperty(SQLExecution.EXECUTION_ROOT_ID_KEY))) | ||
|
|
@@ -926,7 +922,7 @@ class SparkSession private( | |
| scala.util.Try(executionId.toLong).toOption match { | ||
| case Some(executionIdToBeCancelled) => | ||
| val tagToBeCancelled = SQLExecution.executionIdJobTag(this, executionIdToBeCancelled) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice :) |
||
| doInterruptTag(tagToBeCancelled, reason = "", tagIsInternal = true) | ||
| doInterruptTag(tagToBeCancelled, reason = "") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps set a reason?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to let it to have the same reason as APIs in SparkContext. Will udpate. |
||
| case None => | ||
| throw new IllegalArgumentException("executionId must be a number in string form.") | ||
| } | ||
|
|
||
xupefei marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.