BlockInfo

= BlockInfo

BlockInfo is a metadata of storage:BlockId.md[memory block] -- the memory block's <>, the <> and the <>.

BlockInfo has a storage:StorageLevel.md[], ClassTag and tellMaster flag.

== [[size]] Size

size attribute is the size of the memory block. It starts with 0.

It represents the number of bytes that storage:BlockManager.md#putBytes[BlockManager saved] or storage:BlockManager.md#doPutIterator[BlockManager.doPutIterator].

== [[readerCount]] Reader Count -- readerCount Counter

readerCount counter is the number of readers of the memory block, i.e. the number of read locks. It starts with 0.

readerCount is incremented when a storage:BlockInfoManager.md#lockForReading[read lock is acquired] and decreases when the following happens:

  • The storage:BlockManager.md#unlock[memory block is unlocked]

  • storage:BlockInfoManager.md#releaseAllLocksForTask[All locks for the memory block obtained by a task are released].

  • storage:BlockInfoManager.md#removeBlock[memory block is removed]

  • storage:BlockInfoManager.md#clear[Clearing the current state of BlockInfoManager].

== [[writerTask]] Writer Task -- writerTask Attribute

writerTask attribute is the task that owns the write lock for the memory block.

A writer task can be one of the three possible identifiers:

  • [[NO_WRITER]] NO_WRITER (i.e. -1) to denote no writers and hence no write lock in use.

  • [[NON_TASK_WRITER]] NON_TASK_WRITER (i.e. -1024) for non-task threads, e.g. by a driver thread or by unit test code.

  • the task attempt id of the task which currently holds the write lock for this block.

The writer task is assigned in the following scenarios:

  • A storage:BlockInfoManager.md#lockForWriting[write lock is requested for a memory block (with no writer and readers)]

  • A storage:BlockInfoManager.md#unlock[memory block is unlocked]

  • storage:BlockInfoManager.md#releaseAllLocksForTask[All locks obtained by a task are released]

  • A storage:BlockInfoManager.md#removeBlock[memory block is removed]

  • storage:BlockInfoManager.md#clear[Clearing the current state of BlockInfoManager].


Last update: 2020-10-06