Electric.Shapes (electric v1.4.13)
View SourceSummary
Functions
Remove and clean up all data (meta data and shape log + snapshot) associated with the given shape handle
Get the shape handle that corresponds to this shape definition and return it
Get the last exclusive offset of the chunk starting from the given offset
Get the snapshot followed by the log.
Get or create a shape handle and return it along with the latest offset of the shape
Check whether the log has an entry for a given shape handle
Wrap the writing of a snapshot to some Storage backend with the required ShapeStatus update calls.
Cheaply validate that a shape handle matches the shape definition.
Types
@type shape_handle() :: Electric.shape_handle()
@type stack_id() :: Electric.stack_id()
Functions
@spec clean_shape(stack_id(), shape_handle()) :: :ok
Remove and clean up all data (meta data and shape log + snapshot) associated with the given shape handle
@spec clean_shapes(stack_id(), [shape_handle()]) :: :ok
@spec fetch_handle_by_shape(stack_id(), Electric.Shapes.Shape.t()) :: {:ok, shape_handle()} | :error
Get the shape handle that corresponds to this shape definition and return it
@spec fetch_shape_by_handle(stack_id(), shape_handle()) :: Electric.Shapes.Shape.t() | :error
@spec get_chunk_end_log_offset( stack_id(), shape_handle(), Electric.Replication.LogOffset.t() ) :: Electric.Replication.LogOffset.t() | nil
Get the last exclusive offset of the chunk starting from the given offset
If nil is returned, chunk is not complete and the shape's latest offset should be used
Get the snapshot followed by the log.
@spec get_or_create_shape_handle(stack_id(), Electric.Shapes.Shape.t()) :: {shape_handle(), Electric.Replication.LogOffset.t()}
Get or create a shape handle and return it along with the latest offset of the shape
@spec has_shape?(stack_id(), shape_handle()) :: boolean()
Check whether the log has an entry for a given shape handle
@spec make_new_snapshot!( Electric.Shapes.Querying.json_result_stream(), Electric.ShapeCache.Storage.shape_storage(), stack_id(), shape_handle() ) :: :ok | {:error, term()}
Wrap the writing of a snapshot to some Storage backend with the required ShapeStatus update calls.
@spec mark_snapshot_started( Electric.ShapeCache.Storage.shape_storage(), stack_id(), shape_handle() ) :: :ok | {:error, term()}
Cheaply validate that a shape handle matches the shape definition.