Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15915#discussion_r92323575
  
    --- Diff: 
core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala ---
    @@ -303,6 +303,34 @@ class MemoryStoreSuite
         assert(memoryStore.currentUnrollMemoryForThisTask === 0) // discard 
released the unroll memory
       }
     
    +  test("set unrollMemoryThreshold a huge value larger than Int.MaxValue") {
    +    val tmpConf = conf.clone.set("spark.storage.unrollMemoryThreshold", 
s"${1L + Int.MaxValue}")
    +    val (memoryStore, blockInfoManager) = makeMemoryStore(12000L + 
Int.MaxValue, tmpConf)
    +    val smallList = List.fill(40)(new Array[Byte](100))
    +    def smallIterator: Iterator[Any] = 
smallList.iterator.asInstanceOf[Iterator[Any]]
    +    assert(memoryStore.currentUnrollMemoryForThisTask === 0)
    +
    +    def putIteratorAsBytes[T](
    +        blockId: BlockId,
    +        iter: Iterator[T],
    +        classTag: ClassTag[T]): Either[PartiallySerializedBlock[T], Long] 
= {
    +      assert(blockInfoManager.lockNewBlockForWriting(
    +        blockId,
    +        new BlockInfo(StorageLevel.MEMORY_ONLY_SER, classTag, tellMaster = 
false)))
    +      val res = memoryStore.putIteratorAsBytes(blockId, iter, classTag, 
MemoryMode.ON_HEAP)
    +      blockInfoManager.unlock(blockId)
    +      res
    +    }
    +
    +    // Unroll with plenty of space. This should succeed and cache both 
blocks.
    +    val result1 = putIteratorAsBytes("b1", smallIterator, ClassTag.Any)
    +    val result2 = putIteratorAsBytes("b2", smallIterator, ClassTag.Any)
    +    assert(memoryStore.contains("b1"))
    +    assert(memoryStore.contains("b2"))
    +    assert(result1.isRight) // unroll was successful
    +    assert(result2.isRight)
    --- End diff --
    
    nvm. It will be released once unrolling is successful.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to