Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16989#discussion_r116904170
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/MapStatusSuite.scala ---
    @@ -128,4 +138,27 @@ class MapStatusSuite extends SparkFunSuite {
         assert(size1 === size2)
         assert(!success)
       }
    +
    +  test("Blocks which are bigger than spark.shuffle.accurateBlkThreshold 
should not be " +
    +    "underestimated") {
    +    val conf = new SparkConf().set("spark.shuffle.accurateBlkThreshold", 
"1000")
    +    val env = mock(classOf[SparkEnv])
    +    doReturn(conf).when(env).conf
    +    SparkEnv.set(env)
    +    // Value of element in sizes is equal to the corresponding index.
    +    val sizes = (0L to 2000L).toArray
    +    val status1 = MapStatus(BlockManagerId("exec-0", "host-0", 100), sizes)
    +    val arrayStream = new ByteArrayOutputStream(102400)
    +    val objectOutputStream = new ObjectOutputStream(arrayStream)
    +    assert(status1.isInstanceOf[HighlyCompressedMapStatus])
    +    objectOutputStream.writeObject(status1)
    +    objectOutputStream.flush()
    +    val array = arrayStream.toByteArray
    +    val objectInput = new ObjectInputStream(new 
ByteArrayInputStream(array))
    +    val status2 = 
objectInput.readObject().asInstanceOf[HighlyCompressedMapStatus]
    +    (1001 to 2000).foreach {
    +      case part =>
    +        assert(status2.getSizeForBlock(part) >= sizes(part))
    --- End diff --
    
    nit: put this in the same line of the `case part`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to