Class ContainerListOperations

java.lang.Object
org.rostore.v2.container.ContainerListOperations
All Implemented Interfaces:
AutoCloseable

public class ContainerListOperations extends Object implements AutoCloseable
This is the major class to manage the containers on the rostore.

Note that containers are optional components are are not stored on the Media per default.

If containers are required, this class should be created and made persisted on the media. For this the header stored on the media can be modified.

To create the containers on the media the ContainerListOperations(Media, ContainerListProperties) should be executed.

This method will create the ContainerListHeader, which should be persisted on the Media.

When the Media is opened, the ContainerListOperations can be recreated again if the stored ContainerListHeader is provided to the ContainerListOperations(Media, ContainerListHeader), which will reopen the containers in the form as they've been persisted.

  • Constructor Details

    • ContainerListOperations

      public ContainerListOperations(Media media, ContainerListProperties containerListProperties)
      Creates a new container list
      Parameters:
      media - the reference to the file
    • ContainerListOperations

      public ContainerListOperations(Media media, ContainerListHeader containerListHeader)
      Loads an existing container list
      Parameters:
      media -
      containerListHeader -
  • Method Details

    • getContainerListHeader

      public ContainerListHeader getContainerListHeader()
    • closeContainer

      protected void closeContainer(String containerName)
      Use Container.close() to close the containers.

      This function is involved in irs operation and removes the container from the list, and allows to block the list during this operation.

      Parameters:
      containerName - the name of the container to be closed
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • get

      public Container get(String containerName)
    • getMemoryManagement

      public BlockAllocation getMemoryManagement()
    • remove

      public boolean remove(String containerName)
    • listAllContainers

      public List<String> listAllContainers()
    • getMedia

      public Media getMedia()
    • create

      public Container create(String containerName, ContainerMeta containerMeta)
    • evict

      public void evict(String name)
      Should only be used internally
      Parameters:
      name -