Skip to content

Commit f845a10

Browse files
committed
[SPARK-37497][K8S] Promote ExecutorPods[PollingSnapshot|WatchSnapshot]Source to DeveloperApi
1 parent 3657703 commit f845a10

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsPollingSnapshotSource.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ import org.apache.spark.deploy.k8s.Constants._
2929
import org.apache.spark.internal.Logging
3030
import org.apache.spark.util.{ThreadUtils, Utils}
3131

32-
private[spark] class ExecutorPodsPollingSnapshotSource(
32+
/**
33+
* :: DeveloperApi ::
34+
*
35+
* A class used for monitoring executor pods in ExternalClusterManagers.
36+
* @since 2.4.0
37+
*/
38+
@Stable
39+
@DeveloperApi
40+
class ExecutorPodsPollingSnapshotSource(
3341
conf: SparkConf,
3442
kubernetesClient: KubernetesClient,
3543
snapshotsStore: ExecutorPodsSnapshotsStore,
@@ -39,13 +47,15 @@ private[spark] class ExecutorPodsPollingSnapshotSource(
3947

4048
private var pollingFuture: Future[_] = _
4149

50+
@Since("2.4.0")
4251
def start(applicationId: String): Unit = {
4352
require(pollingFuture == null, "Cannot start polling more than once.")
4453
logDebug(s"Starting to check for executor pod state every $pollingInterval ms.")
4554
pollingFuture = pollingExecutor.scheduleWithFixedDelay(
4655
new PollRunnable(applicationId), pollingInterval, pollingInterval, TimeUnit.MILLISECONDS)
4756
}
4857

58+
@Since("2.4.0")
4959
def stop(): Unit = {
5060
if (pollingFuture != null) {
5161
pollingFuture.cancel(true)

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsWatchSnapshotSource.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@ import org.apache.spark.deploy.k8s.Constants._
2626
import org.apache.spark.internal.Logging
2727
import org.apache.spark.util.Utils
2828

29-
private[spark] class ExecutorPodsWatchSnapshotSource(
29+
/**
30+
* :: DeveloperApi ::
31+
*
32+
* A class used for K8s executor pod monitoring in ExternalClusterManagers.
33+
* @since 2.4.0
34+
*/
35+
@Stable
36+
@DeveloperApi
37+
class ExecutorPodsWatchSnapshotSource(
3038
snapshotsStore: ExecutorPodsSnapshotsStore,
3139
kubernetesClient: KubernetesClient) extends Logging {
3240

3341
private var watchConnection: Closeable = _
3442

43+
@Since("2.4.0")
3544
def start(applicationId: String): Unit = {
3645
require(watchConnection == null, "Cannot start the watcher twice.")
3746
logDebug(s"Starting watch for pods with labels $SPARK_APP_ID_LABEL=$applicationId," +
@@ -42,6 +51,7 @@ private[spark] class ExecutorPodsWatchSnapshotSource(
4251
.watch(new ExecutorPodsWatcher())
4352
}
4453

54+
@Since("2.4.0")
4555
def stop(): Unit = {
4656
if (watchConnection != null) {
4757
Utils.tryLogNonFatalError {

0 commit comments

Comments
 (0)