Class MediaProperties

java.lang.Object
org.rostore.v2.media.MediaProperties

public class MediaProperties extends Object
Properties of the media that defines its major parameters.

This is an immutable variant to prevent its changes after the media is created.

Use MediaPropertiesBuilder to populate the fields and then create this object.

  • Constructor Details

    • MediaProperties

      public MediaProperties()
  • Method Details

    • from

      public static MediaProperties from(MediaPropertiesBuilder builder)
      Used to create the MediaProperties based on the desired input in form of MediaPropertiesBuilder.

      Note that some fields might be corrected and deviate from the original.

      Parameters:
      builder - the object with the data
      Returns:
      a read-only copy of the builder's data
    • getTotalBlockNumber

      public long getTotalBlockNumber()
      Provides the total number of blocks that the storage supports
      Returns:
      the number of blocks
    • getMaxTotalSize

      public long getMaxTotalSize()
      Provides the total maximum size of the storage
      Returns:
      the size in bytes
    • getBlockSize

      public int getBlockSize()
      Provides the block size
      Returns:
      the block size in bytes
    • getCloseUnusedBlocksAfterMillis

      public long getCloseUnusedBlocksAfterMillis()
      Provides the time interval in milliseconds after each the unused blocks will be removed from the memory.

      The caching of unused block is only used fo the blocks of CATALOG or KEY types.

      Returns:
      the time interval in milliseconds
    • getCloseUnusedSequencesAfterMillis

      public long getCloseUnusedSequencesAfterMillis()
      Gets the time interval in milliseconds after each the unused block sequences will be removed from the memory.

      Sequences combine several blocks in one continues data block, which is used in the ro-store controlling structures such as catalogs or key blocks.

      Returns:
      the time interval in milliseconds
    • getMapperProperties

      public MapperProperties getMapperProperties()
      The mapper properties that are calculated based on the storage properties
      Returns:
      the mapper properties