Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,80 @@ package org.apache.spark.scheduler.cluster.k8s

import io.fabric8.kubernetes.api.model.Pod

import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.annotation.{DeveloperApi, Since}
import org.apache.spark.resource.ResourceProfile


/**
* :: DeveloperApi ::
* A abstract interface for allowing different types of pods allocation.
*
* The internal Spark implementations are [[StatefulSetPodsAllocator]]
* and [[ExecutorPodsAllocator]]. This may be useful for folks integrating with custom schedulers.
*
* This API may change or be removed at anytime.
* The internal Spark implementations are [[StatefulSetPodsAllocator]],
* [[DeploymentPodsAllocator]], and [[ExecutorPodsAllocator]].
* This may be useful for folks integrating with custom schedulers.
*
* @since 3.3.0
*/
@DeveloperApi
@Since("3.3.0")
abstract class AbstractPodsAllocator {
/*
/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apache Spark uses Javadoc style instead of Scaladoc.

* Optional lifecycle manager for tracking executor pod lifecycle events.
* Set via setExecutorPodsLifecycleManager for backward compatibility.
*
* @since 4.2.0
*/
@Since("4.2.0")
protected var executorPodsLifecycleManager: Option[ExecutorPodsLifecycleManager] = None

/*
/**
* Set the lifecycle manager for tracking executor pod lifecycle events.
* This method is optional and may not exist in custom implementations based on older versions.
*
* @since 4.2.0
*/
@Since("4.2.0")
def setExecutorPodsLifecycleManager(manager: ExecutorPodsLifecycleManager): Unit = {
executorPodsLifecycleManager = Some(manager)
}

/*
/**
* Set the total expected executors for an application
*
* @since 3.3.0
*/
@Since("3.3.0")
def setTotalExpectedExecutors(resourceProfileToTotalExecs: Map[ResourceProfile, Int]): Unit
/*

/**
* Reference to driver pod.
*
* @since 3.3.0
*/
@Since("3.3.0")
def driverPod: Option[Pod]
/*

/**
* If the pod for a given exec id is deleted.
*
* @since 3.3.0
*/
@Since("3.3.0")
def isDeleted(executorId: String): Boolean
/*

/**
* Start hook.
*
* @since 3.3.0
*/
@Since("3.3.0")
def start(applicationId: String, schedulerBackend: KubernetesClusterSchedulerBackend): Unit
/*

/**
* Stop hook
*
* @since 3.3.0
*/
@Since("3.3.0")
def stop(applicationId: String): Unit
}