Bedrock.DataPlane.Log.Shale.SegmentRecycler (bedrock v0.5.2)

View Source

Manages segment file allocation and recycling for the Shale log.

Summary

Functions

Return a segment to the recycler. The recycler will attempt to delete the segment if it has too many on-hand.

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

server()

@type server() :: GenServer.server()

Functions

check_in(segment_recycler, segment)

@spec check_in(server(), path :: String.t()) :: :ok

Return a segment to the recycler. The recycler will attempt to delete the segment if it has too many on-hand.

check_out(segment_recycler, new_path)

@spec check_out(server(), new_path :: String.t()) :: :ok | {:error, term()}

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.

child_spec(args)

@spec child_spec(term()) :: Supervisor.child_spec()