Interface BlockProvider

All Known Implementing Classes:
InternalBlockProvider

public interface BlockProvider
A structure that combines both BlockAllocator and BlockContainer.

In many classes it allows to split the low-level transaction blocks collection (BlockContainer) and their intended allocation approach (BlockAllocator from the high-level operation.

  • Method Details

    • getBlockContainer

      BlockContainer getBlockContainer()
      Provides a block container.

      Used to account the set of blocks that participate in one specific transaction.

      Returns:
      the block container
    • getBlockAllocator

      BlockAllocator getBlockAllocator()
      Provides a block allocator

      Used to allocate new blocks from the set of free blocks nad mark them as used.

      Returns:
      the block allocator
    • getMedia

      Media getMedia()
      Provides an associated Media object
      Returns:
      the media object
    • allocateBlock

      default Block allocateBlock(BlockType blockType)
      Allocates a block with the help of BlockAllocator and adds it to the associated BlockContainer.
      Parameters:
      blockType - a block type
      Returns:
      the block that has been allocated and added to the block container
    • freeBlock

      default void freeBlock(long blockIndex)
      Frees a block from the allocator and removes it from the container.
      Parameters:
      blockIndex - the index of the block