Bedrock.DataPlane.Log.Shale.SegmentRecycler (bedrock v0.7.0)
View SourceManages segment file allocation and recycling for the Shale log.
Summary
Functions
Return a segment to the recycler. The recycler will delete the segment
if it is already holding max_available of them.
Ask the recycler for a fresh segment. The recycler will return one of the segments that it has on-hand, and will attempt to allocate a new one if necessary.
Types
@type server() :: GenServer.server()
Functions
@spec check_in(server(), path :: String.t()) :: :ok | {:error, File.posix()}
Return a segment to the recycler. The recycler will delete the segment
if it is already holding max_available of them.
Returns the unlink's error if that deletion fails; callers that match
on :ok will crash the log and re-recover, which is the same exposure
the rename this replaced always had.
Ask the recycler for a fresh segment. The recycler will return one of the segments that it has on-hand, and will attempt to allocate a new one if necessary.
@spec child_spec(term()) :: Supervisor.child_spec()