aglinxinyuan commented on code in PR #4444:
URL: https://github.com/apache/texera/pull/4444#discussion_r3144876308


##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/Schedule.scala:
##########
@@ -19,16 +19,11 @@
 
 package org.apache.texera.amber.engine.architecture.scheduling
 
-case class Schedule(private val levelSets: Map[Int, Set[Region]]) extends 
Iterator[Set[Region]] {
-  private var currentLevel = levelSets.keys.minOption.getOrElse(0)
+case class Schedule(levelSets: Map[Int, Set[Region]]) extends 
Iterable[Set[Region]] {

Review Comment:
   Not strictly required, but I think `Iterable` is a better fit here.
   
   If `Schedule` extends `Iterator`, then `Schedule` itself becomes stateful 
and gets consumed during traversal. In this PR I’m trying to keep `Schedule` 
immutable/static, and keep traversal state in the coordinator/controller 
instead. `Iterable` matches that design better.



-- 
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]

Reply via email to