ChrisMuki commented on code in PR #57257:
URL: https://github.com/apache/spark/pull/57257#discussion_r3601164305
##########
core/src/main/scala/org/apache/spark/scheduler/Schedulable.scala:
##########
@@ -21,16 +21,19 @@ import java.util.concurrent.ConcurrentLinkedQueue
import scala.collection.mutable.ArrayBuffer
+import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.scheduler.SchedulingMode.SchedulingMode
/**
- * An interface for schedulable entities.
- * there are two type of Schedulable entities(Pools and TaskSetManagers)
+ * :: DeveloperApi ::
+ * An interface for schedulable entities (there are two types: Pools and
TaskSetManagers).
+ *
+ * Only the read-only scheduling properties below are part of the public API
surface; they are the
+ * inputs a custom [[SchedulingAlgorithm]] can inspect in its `comparator`.
The structural and
+ * mutating members are Spark-internal (`private[spark]`) and must not be used
by applications.
*/
-private[spark] trait Schedulable {
- var parent: Pool
- // child queues
- def schedulableQueue: ConcurrentLinkedQueue[Schedulable]
+@DeveloperApi
Review Comment:
One alternative solution would be adding a kind of
@DeveloperApi case class SchedulableInfo
holding all the sorting relevant fields.
Additionally a custom algorithm class would need to be implemented that is
taking a sort method with these SchedulableInfo objects.
Benefit would be keeping Schedulable private and having a concrete
conversion to a SchedulableInfo object
Downside would be additional classes.
What's you thoughts on this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]