Package org.rostore.v2.media
Class MediaProperties
java.lang.Object
org.rostore.v2.media.MediaProperties
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MediaProperties
from
(MediaPropertiesBuilder builder) Used to create the MediaProperties based on the desired input in form ofMediaPropertiesBuilder
.int
Provides the block sizelong
Provides the time interval in milliseconds after each the unused blocks will be removed from the memory.long
Gets the time interval in milliseconds after each the unused block sequences will be removed from the memory.The mapper properties that are calculated based on the storage propertieslong
Provides the total maximum size of the storagelong
Provides the total number of blocks that the storage supports
-
Constructor Details
-
MediaProperties
public MediaProperties()
-
-
Method Details
-
from
Used to create the MediaProperties based on the desired input in form ofMediaPropertiesBuilder
.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
The mapper properties that are calculated based on the storage properties- Returns:
- the mapper properties
-