You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/12 12:18:32 UTC

[GitHub] [spark] LuciferYang edited a comment on pull request #30351: [MINOR][CORE] Remove unused imports in core module

LuciferYang edited a comment on pull request #30351:
URL: https://github.com/apache/spark/pull/30351#issuecomment-726043120


   @HyukjinKwon Looks like `-Ywarn-unused ` can works, but there are some configuration differences between `pom.xml` and `SparkBuild.scala`,  `-Xfatal-warnings` is only configured in `SparkBuild.scala`. 
   
   After add `-Ywarn-unused` to `pom.xml`, there are some waring messages as follows:
   
   ```
   [WARNING] [Warn] /spark/core/src/main/scala-2.12/org/apache/spark/util/TimeStampedHashMap.scala:95: pattern var t in value $anonfun is never used; `t@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/BarrierTaskContext.scala:24: Unused import
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/ContextCleaner.scala:204: pattern var ie in method keepCleaning is never used; `ie@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/ContextCleaner.scala:252: parameter value blocking in method doCleanupAccum is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala:100: parameter value triggeredByExecutor in method decommissionExecutors is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:326: private method totalRunningTasksPerResourceProfile in class ExecutorAllocationManager is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:784: pattern var k in value $anonfun is never used; `k@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:38: Unused import
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:139: pattern var e in method updateMapOutput is never used; `e@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:472: pattern var ie in method run is never used; `ie@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:698: pattern var loc in value $anonfun is never used; `loc@_' suppresses this warning
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:283: parameter value conf in class MapOutputTrackerMasterEndpoint is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:308: parameter value conf in class MapOutputTracker is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:426: parameter value i in value $anonfun is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:519: parameter value x in value $anonfun is never used
   [WARNING] [Warn] /spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala:671: parameter value numReducers in method getLocationsWithLargestOutputs is never used
   ```
   
   After add `-Ywarn-unused` and `-Xfatal-warnings` to `pom.xml` , the`[WARNING]` convert to `[ERROR]`, maybe we can use `-Ywarn-unused-import` to clean up unused imports first?


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org