protocols
What the collaborators split out of Pod need from one another.
Each collaborator takes the narrowest of these that covers what it calls, so the coupling between them is visible in their constructors.
Classes
BackgroundCacheState
class BackgroundCacheState(*args, **kwargs):Whether the background cache can be used by this build.
Ancestors
Subclasses
Variables
cache_unusable : bool- True once the cache has been found unusable.
BackgroundScheduler
class BackgroundScheduler(*args, **kwargs):Schedules background DAG runs, and opens the cache they share.
Variables
cache_unusable : bool- True once the cache has been found unusable.
Methods
lineage_live
async def lineage_live(self, task_hash: str, project_id: str) ‑> bool:Whether a run of the lineage is, or may be, live.
Answers from this pod's own runner subprocesses before Prefect's state,
and True whenever neither can say.
open_cache
def open_cache( self, *, take_backup: bool = True, phase_seconds: dict[str, float] | None = None,) ‑> CacheProtocol | None:Open the background cache, or None once it is unusable.
Arguments
take_backup: Whether to take the on-open backup; a read-only opener can leave the snapshot to the openers that write.phase_seconds: When given, the timing of each blocking step of the open is added to it, in seconds, by step name.
schedule_from_record
def schedule_from_record( self, record: FlowSpecRecord, *, trigger: BackgroundTrigger, attempt: int, monitor_task_id: str, is_rerun: bool | None = None,) ‑> None:Schedule a run of the lineage record describes.
DatasourceMetadataRecorder
class DatasourceMetadataRecorder(*args, **kwargs):Records the indexing-order metadata the nightly refresh reads.
Ancestors
Methods
record_datasource_metadata
def record_datasource_metadata(self) ‑> MetadataKickoffPlan | None:Record it, returning the kickoff plan if one was made.
EHRStatus
class EHRStatus(*args, **kwargs):What the heartbeat reports about the pod's EHR connection.
Ancestors
Variables
cached_connected : bool- The last connectivity result, without checking again.
is_configured : bool- True if the pod has an EHR configuration.
HealthReporter
class HealthReporter(*args, **kwargs):Datasource health, and an out-of-cycle heartbeat.
Ancestors
Variables
cached_datasource_health : list[dict[str, str]] | None- The last health check's result, orNonebefore the first.
Methods
collect_datasource_health
def collect_datasource_health(self) ‑> list[dict[str, str]]:Check every datasource now.
set_cached_datasource_health
def set_cached_datasource_health(self, value: list[dict[str, str]] | None) ‑> None:Replace the cached health with a freshly collected result.
trigger_heartbeat
def trigger_heartbeat(self) ‑> None:Send a heartbeat now rather than at the next tick.
IndexedFileCounter
class IndexedFileCounter(*args, **kwargs):How many files the metadata index holds for a lineage's datasource.
Ancestors
Methods
indexed_file_count
def indexed_file_count(self, cache: CacheProtocol, record: FlowSpecRecord) ‑> int | None:The count, or None if it cannot be read.
InteractiveRouter
class InteractiveRouter(*args, **kwargs):Routes a JOB_REQUEST that carries an interactive DAG.
Ancestors
Methods
as_interactive_request
def as_interactive_request(self, message: _BitfountMessage) ‑> _TaskRequestMessage | None:The request, if message triggers an interactive DAG.
handle
async def handle(self, message: _BitfountMessage, trigger: InteractiveTrigger) ‑> None:Run the interactive DAG message triggers.
SchemaGenerationHolds
class SchemaGenerationHolds(*args, **kwargs):Keeps background schema generation off while a task reads datasources.
Ancestors
Methods
hold_schema_generation
def hold_schema_generation(self) ‑> None:Take one hold.
release_schema_generation
def release_schema_generation(self) ‑> None:Release one hold.
V8TaskRunner
class V8TaskRunner(*args, **kwargs):Runs a JOB_REQUEST as a v8 federated task.
Ancestors
Methods
run
async def run(self, message: _BitfountMessage) ‑> None:Run the v8 federated task message carries.