pan3793 commented on code in PR #45907:
URL: https://github.com/apache/spark/pull/45907#discussion_r1554635891
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ConnectProgressExecutionListener.scala:
##########
@@ -82,10 +82,14 @@ private[connect] class ConnectProgressExecutionListener
extends SparkListener wi
*
* If the tracker was marked as dirty, the state is reset after.
*/
- def yieldWhenDirty(thunk: (Seq[StageInfo], Long) => Unit): Unit = {
- if (dirty.get()) {
+ def yieldWhenDirty(force: Boolean = false, thunk: (Seq[StageInfo], Long)
=> Unit): Unit = {
Review Comment:
you may want to defined it as
```suggestion
def yieldWhenDirty(force: Boolean = false)(thunk: (Seq[StageInfo], Long)
=> Unit): Unit = {
```
then the caller side could be written in
```
tracker.yieldWhenDirty(force) { (stages, inflightTasks) =>
...
}
```
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ConnectProgressExecutionListener.scala:
##########
@@ -82,10 +82,14 @@ private[connect] class ConnectProgressExecutionListener
extends SparkListener wi
*
* If the tracker was marked as dirty, the state is reset after.
*/
- def yieldWhenDirty(thunk: (Seq[StageInfo], Long) => Unit): Unit = {
- if (dirty.get()) {
+ def yieldWhenDirty(force: Boolean = false, thunk: (Seq[StageInfo], Long)
=> Unit): Unit = {
Review Comment:
you may want to define it as
```suggestion
def yieldWhenDirty(force: Boolean = false)(thunk: (Seq[StageInfo], Long)
=> Unit): Unit = {
```
then the caller side could be written in
```
tracker.yieldWhenDirty(force) { (stages, inflightTasks) =>
...
}
```
--
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]