jiangxb1987 commented on a change in pull request #26916:
[SPARK-25100][TEST][FOLLOWUP] Refactor test cases in `FileSuite` and
`KryoSerializerSuite`
URL: https://github.com/apache/spark/pull/26916#discussion_r358569339
##########
File path:
core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala
##########
@@ -363,16 +363,14 @@ class KryoSerializerSuite extends SparkFunSuite with
SharedSparkContext {
val conf = new SparkConf(false)
conf.set(KRYO_REGISTRATION_REQUIRED, true)
- val ser = new KryoSerializer(conf).newInstance()
- // In HadoopMapReduceCommitProtocol#commitTask
- val addedAbsPathFiles: mutable.Map[String, String] = mutable.Map()
- addedAbsPathFiles.put("test1", "test1")
- addedAbsPathFiles.put("test2", "test2")
+ // HadoopMapReduceCommitProtocol.commitTask() returns a TaskCommitMessage
containing a complex
+ // structure.
- val partitionPaths: mutable.Set[String] = mutable.Set()
- partitionPaths.add("test3")
+ val ser = new KryoSerializer(conf).newInstance()
+ val addedAbsPathFiles = Map("test1" -> "test1", "test2" -> "test2")
+ val partitionPaths = Set("test3")
- val taskCommitMessage1 = new TaskCommitMessage(addedAbsPathFiles.toMap ->
partitionPaths.toSet)
+ val taskCommitMessage1 = new TaskCommitMessage(addedAbsPathFiles ->
partitionPaths)
Review comment:
We only need to test the object returned by
`HadoopMapReduceCommitProtocol.commitTask()`, thus no need to create a mutable
map/set then convert it.
----------------------------------------------------------------
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]