Bedrock.DataPlane.Materializer.Olivine.Reading (bedrock v0.5.3)

View Source

Manages read request tasks and waitlists for Olivine storage.

Handles active task tracking, process monitoring, and waitlist management for read operations that cannot be immediately satisfied.

Summary

Functions

Returns the set of active task PIDs.

Handle a get request with full lifecycle management (async, waitlist, task tracking). Returns {updated_manager, result}.

Handle a get_range request with full lifecycle management (async, waitlist, task tracking). Returns {updated_manager, result}.

Creates a new empty read request manager.

Removes all waiting fetches for a version and processes them with fetch logic. Returns updated_manager.

Removes an active task from tracking with telemetry.

Shuts down the read request manager by waiting for active tasks and notifying waiting fetches.

Types

t()

@type t() :: %Bedrock.DataPlane.Materializer.Olivine.Reading{
  active_tasks: MapSet.t(pid()),
  waiting_fetches: Bedrock.Internal.WaitingList.t()
}

Functions

get_active_tasks(manager)

@spec get_active_tasks(t()) :: MapSet.t(pid())

Returns the set of active task PIDs.

handle_get(manager, context, key_or_selector, version, opts)

Handle a get request with full lifecycle management (async, waitlist, task tracking). Returns {updated_manager, result}.

handle_get_range(manager, context, start_key, end_key, version, opts)

Handle a get_range request with full lifecycle management (async, waitlist, task tracking). Returns {updated_manager, result}.

new()

@spec new() :: t()

Creates a new empty read request manager.

notify_waiting_fetches(manager, context, applied_version)

Removes all waiting fetches for a version and processes them with fetch logic. Returns updated_manager.

remove_active_task(manager, task_pid)

@spec remove_active_task(t(), pid()) :: t()

Removes an active task from tracking with telemetry.

shutdown(manager)

@spec shutdown(t()) :: :ok

Shuts down the read request manager by waiting for active tasks and notifying waiting fetches.