Electric.Shapes.Consumer.Subqueries.ActiveMove (electric v1.6.2)

Copy Markdown View Source

Summary

Types

move_value()

@type move_value() :: {term(), term()}

t()

@type t() :: %Electric.Shapes.Consumer.Subqueries.ActiveMove{
  boundary_txn_count: non_neg_integer() | nil,
  buffered_txn_count: non_neg_integer(),
  buffered_txns: [Electric.Replication.Changes.Transaction.t()],
  dep_index: non_neg_integer(),
  dep_move_kind: :move_in | :move_out,
  latest_seen_lsn: Electric.Postgres.Lsn.t() | nil,
  move_in_lsn: Electric.Postgres.Lsn.t() | nil,
  move_in_row_bytes: non_neg_integer() | nil,
  move_in_row_count: non_neg_integer() | nil,
  move_in_snapshot_name: String.t() | nil,
  snapshot: {term(), term(), [term()]} | nil,
  subquery_ref: [String.t()],
  values: [move_value()],
  views_after_move: Electric.Shapes.Consumer.Subqueries.Views.t(),
  views_before_move: Electric.Shapes.Consumer.Subqueries.Views.t()
}

Functions

buffer_txn(active_move, txn)

@spec buffer_txn(t(), Electric.Replication.Changes.Transaction.t()) :: t()

buffered_txn_count(active_move)

@spec buffered_txn_count(t()) :: non_neg_integer()

carry_latest_seen_lsn(active_move, latest_seen_lsn)

@spec carry_latest_seen_lsn(t(), Electric.Postgres.Lsn.t() | nil) :: t()

last_buffered_log_offset(active_move)

@spec last_buffered_log_offset(t()) :: Electric.Replication.LogOffset.t() | nil

ready_to_splice?(active_move)

@spec ready_to_splice?(t()) :: boolean()

record_query_complete!(active_move, snapshot_name, row_count, row_bytes, move_in_lsn)

@spec record_query_complete!(
  t(),
  String.t(),
  non_neg_integer(),
  non_neg_integer(),
  Electric.Postgres.Lsn.t()
) :: t()

record_seen_lsn(active_move, lsn)

@spec record_seen_lsn(t(), Electric.Postgres.Lsn.t()) :: t()

record_snapshot!(active_move, snapshot)

@spec record_snapshot!(t(), {term(), term(), [term()]}) :: t()

split_buffer(active_move)

start(views, dep_index, dep_move_kind, subquery_ref, values)

@spec start(
  Electric.Shapes.Consumer.Subqueries.Views.t(),
  non_neg_integer(),
  :move_in | :move_out,
  [String.t()],
  [move_value()]
) :: t()