Bedrock.DataPlane.Log.Shale.Segment (bedrock v0.5.2)
View SourceRepresents a segment of the Shale transaction log.
Summary
Functions
Create a new segment from the given file path. We stat the file to get the size, ensuring that it exists.
Types
@type t() :: %Bedrock.DataPlane.Log.Shale.Segment{ min_version: Bedrock.version(), path: String.t(), transactions: nil | [Bedrock.DataPlane.Transaction.encoded()] }
Functions
@spec allocate_from_recycler( Bedrock.DataPlane.Log.Shale.SegmentRecycler.server(), String.t(), Bedrock.version() ) :: {:ok, t()} | {:error, :allocation_failed}
@spec allocate_from_recycler!( Bedrock.DataPlane.Log.Shale.SegmentRecycler.server(), String.t(), Bedrock.version() ) :: t()
@spec decode_file_name(String.t()) :: pos_integer()
@spec encode_file_name(pos_integer()) :: String.t()
@spec file_prefix() :: String.t()
Create a new segment from the given file path. We stat the file to get the size, ensuring that it exists.
@spec last_version(t()) :: Bedrock.version() | nil
@spec oldest_version(t()) :: Bedrock.version()
@spec return_to_recycler(t(), Bedrock.DataPlane.Log.Shale.SegmentRecycler.server()) :: :ok
@spec transactions(t()) :: [Bedrock.DataPlane.Transaction.encoded()]