Class RootBlockAllocator

java.lang.Object
org.rostore.v2.media.block.allocator.RootBlockAllocator

public class RootBlockAllocator extends Object
Major allocator for the Media. All Block allocations should happen over this instance.

The instance is responsible for accounting of all blocks and manages a table (base don CatalogBlockOperations) that register all free blocks-

To accelerate operation the CachedCatalogBlockOperations is used, that holds specified list of blocks ready for allocation, effectively taking them from the pool of free blocks.

  • Constructor Details

    • RootBlockAllocator

      public RootBlockAllocator()
  • Method Details

    • create

      public static BlockAllocator create(Media media)
      Creates a new root block allocator.

      This operation should only be executed once.

      Parameters:
      media - the media the root allocator is created in.
      Returns:
    • load

      public static BlockAllocator load(Media media)