srowen commented on a change in pull request #24463:
[SPARK-27571][CORE][YARN][EXAMPLES] Avoid scala.language.reflectiveCalls
URL: https://github.com/apache/spark/pull/24463#discussion_r278762927
##########
File path:
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
##########
@@ -165,13 +164,13 @@ class DAGSchedulerSuite extends SparkFunSuite with
LocalSparkContext with TimeLi
/** Length of time to wait while draining listener events. */
val WAIT_TIMEOUT_MILLIS = 10000
- val sparkListener = new SparkListener() {
- val submittedStageInfos = new HashSet[StageInfo]
- val successfulStages = new HashSet[Int]
- val failedStages = new ArrayBuffer[Int]
- val stageByOrderOfExecution = new ArrayBuffer[Int]
- val endedTasks = new HashSet[Long]
+ val submittedStageInfos = new HashSet[StageInfo]
Review comment:
The general pattern is to move state and methods defined in anonymous inner
classes outside of the class, where they're still perfectly accessible by the
class and rest of the code.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]