public class StorageStatus
extends Object
This class assumes BlockId and BlockStatus are immutable, such that the consumers of this class cannot mutate the source of the information. Accesses are not thread-safe.
Constructor and Description |
---|
StorageStatus(BlockManagerId blockManagerId,
long maxMem) |
StorageStatus(BlockManagerId bmid,
long maxMem,
scala.collection.Map<BlockId,BlockStatus> initialBlocks)
Create a storage status with an initial set of blocks, leaving the source unmodified.
|
Modifier and Type | Method and Description |
---|---|
BlockManagerId |
blockManagerId() |
scala.collection.Map<BlockId,BlockStatus> |
blocks()
Return the blocks stored in this block manager.
|
boolean |
containsBlock(BlockId blockId)
Return whether the given block is stored in this block manager in O(1) time.
|
long |
diskUsed()
Return the disk space used by this block manager.
|
long |
diskUsedByRdd(int rddId)
Return the disk space used by the given RDD in this block manager in O(1) time.
|
scala.Option<BlockStatus> |
getBlock(BlockId blockId)
Return the given block stored in this block manager in O(1) time.
|
long |
maxMem() |
long |
memRemaining()
Return the memory remaining in this block manager.
|
long |
memUsed()
Return the memory used by this block manager.
|
long |
memUsedByRdd(int rddId)
Return the memory used by the given RDD in this block manager in O(1) time.
|
int |
numBlocks()
Return the number of blocks stored in this block manager in O(RDDs) time.
|
int |
numRddBlocks()
Return the number of RDD blocks stored in this block manager in O(RDDs) time.
|
int |
numRddBlocksById(int rddId)
Return the number of blocks that belong to the given RDD in O(1) time.
|
long |
offHeapUsed()
Return the off-heap space used by this block manager.
|
long |
offHeapUsedByRdd(int rddId)
Return the off-heap space used by the given RDD in this block manager in O(1) time.
|
scala.collection.Map<BlockId,BlockStatus> |
rddBlocks()
Return the RDD blocks stored in this block manager.
|
scala.collection.Map<BlockId,BlockStatus> |
rddBlocksById(int rddId)
Return the blocks that belong to the given RDD stored in this block manager.
|
scala.Option<StorageLevel> |
rddStorageLevel(int rddId)
Return the storage level, if any, used by the given RDD in this block manager.
|
public StorageStatus(BlockManagerId blockManagerId, long maxMem)
public StorageStatus(BlockManagerId bmid, long maxMem, scala.collection.Map<BlockId,BlockStatus> initialBlocks)
public BlockManagerId blockManagerId()
public long maxMem()
public scala.collection.Map<BlockId,BlockStatus> blocks()
Note that this is somewhat expensive, as it involves cloning the underlying maps and then concatenating them together. Much faster alternatives exist for common operations such as contains, get, and size.
public scala.collection.Map<BlockId,BlockStatus> rddBlocks()
Note that this is somewhat expensive, as it involves cloning the underlying maps and then concatenating them together. Much faster alternatives exist for common operations such as getting the memory, disk, and off-heap memory sizes occupied by this RDD.
public scala.collection.Map<BlockId,BlockStatus> rddBlocksById(int rddId)
public boolean containsBlock(BlockId blockId)
this.blocks.contains
, which is O(blocks) time.blockId
- (undocumented)public scala.Option<BlockStatus> getBlock(BlockId blockId)
this.blocks.get
, which is O(blocks) time.blockId
- (undocumented)public int numBlocks()
this.blocks.size
, which is O(blocks) time.public int numRddBlocks()
this.rddBlocks.size
, which is O(RDD blocks) time.public int numRddBlocksById(int rddId)
this.rddBlocksById(rddId).size
, which is
O(blocks in this RDD) time.rddId
- (undocumented)public long memRemaining()
public long memUsed()
public long diskUsed()
public long offHeapUsed()
public long memUsedByRdd(int rddId)
public long diskUsedByRdd(int rddId)
public long offHeapUsedByRdd(int rddId)
public scala.Option<StorageLevel> rddStorageLevel(int rddId)