Hyper.Img.Db.Blob (Hyper v0.1.0)

Copy Markdown View Source

An immutable, content-addressed leaf object stored on NFS - a base (P.img) or a delta (L.img). The id is both primary key and identity, so inserts are conflict-free: two nodes publishing the same bytes write the same row.

The only field that ever changes is state, flipped to :deleting as a tombstone during a coordinated delete so no new lease can be taken against it.

Summary

Functions

Keyset page of {id, size} for :present blobs after after_id (nil to start), ordered by id.

Types

t()

@type t() :: %Hyper.Img.Db.Blob{
  __meta__: term(),
  id: term(),
  inserted_at: term(),
  kind: term(),
  size: term(),
  state: term()
}

Functions

changeset(blob, attrs)

present_after(after_id, limit)

@spec present_after(String.t() | nil, pos_integer()) :: [
  {String.t(), non_neg_integer()}
]

Keyset page of {id, size} for :present blobs after after_id (nil to start), ordered by id.