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

    https://github.com/apache/spark/pull/2851#discussion_r26393712
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/StorageUtils.scala 
---
    @@ -166,28 +195,69 @@ class StorageStatus(val blockManagerId: 
BlockManagerId, val maxMem: Long) {
        * Note that this is much faster than `this.rddBlocksById(rddId).size`, 
which is
        * O(blocks in this RDD) time.
        */
    -  def numRddBlocksById(rddId: Int): Int = 
_rddBlocks.get(rddId).map(_.size).getOrElse(0)
    +  def numRddBlocksById(rddId: Long): Int = 
_rddBlocks.get(rddId).map(_.size).getOrElse(0)
    +
    +
    +  /**
    +   * Return the number of Broadcast blocks stored in this block manager in 
O(RDDs) time.
    +   * Note that this is much faster than `this.rddBlocks.size`, which is 
O(RDD blocks) time.
    +   */
    +  def numBroadcastBlocks: Int = _broadcastBlocks.values.map(_.size).sum
    +
    +  /**
    +   * Return the number of blocks that belong to the given Broadcast 
variable in O(1) time.
    +   * Note that this is much faster than `this.rddBlocksById(rddId).size`, 
which is
    +   * O(blocks in this RDD) time.
    --- End diff --
    
    same here


---
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