FerricStore.Flow.QueryIndexProvider behaviour (ferricstore v0.10.0)

Copy Markdown View Source

Immutable instance boundary for the versioned composite-index registry.

Providers publish one bounded snapshot per LMDB writer expansion batch. Building and validating indexes remain in the projection set for online migration. Retiring indexes leave the projection set before their writer fence and physical cleanup, while only active indexes are visible to queries.

Summary

Callbacks

child_specs(arg1)

(optional)
@callback child_specs(FerricStore.Instance.t() | map()) :: [Supervisor.child_spec()]

snapshot(arg1, non_neg_integer)

@callback snapshot(FerricStore.Instance.t() | map(), non_neg_integer()) ::
  {:ok, Ferricstore.Flow.Query.RegistrySnapshot.t()} | {:error, term()}

Functions

active_indexes(ctx, shard_index)

@spec active_indexes(FerricStore.Instance.t() | map(), non_neg_integer()) ::
  {:ok, [Ferricstore.Flow.Query.RegisteredIndex.t()]} | {:error, atom()}

child_specs(ctx)

@spec child_specs(FerricStore.Instance.t() | map()) ::
  {:ok, [Supervisor.child_spec()]} | {:error, :query_index_provider_failure}

configured_implementation(opts)

@spec configured_implementation(keyword()) :: module()

enabled?(ctx)

@spec enabled?(FerricStore.Instance.t() | map()) :: boolean()

projection_definitions(ctx, shard_index)

@spec projection_definitions(FerricStore.Instance.t() | map(), non_neg_integer()) ::
  {:ok, [Ferricstore.Flow.Query.IndexDefinition.t()]} | {:error, atom()}

snapshot(ctx, shard_index)

@spec snapshot(FerricStore.Instance.t() | map(), non_neg_integer()) ::
  {:ok, Ferricstore.Flow.Query.RegistrySnapshot.t()} | {:error, atom()}

validate_implementation!(implementation)

@spec validate_implementation!(term()) :: module()