bookclerk_library::entities::nodes

Development These docs follow the development version and change with every merge.

Last updated View as Markdown

SeaORM entity for durable node identity and liveness observations.

Item Kind Summary
Model struct Row shape for one Bookclerk node in the library.
ColumnIter struct An iterator over the variants of [Column]
Entity struct Generated by sea-orm-macros
PrimaryKeyIter struct An iterator over the variants of [PrimaryKey]
ActiveModel struct Generated by sea-orm-macros
RelationIter struct An iterator over the variants of [Relation]
Column enum Generated by sea-orm-macros
PrimaryKey enum Generated by sea-orm-macros
Relation enum Declared SeaORM relations (nodes are addressed by node_id).

Structs

Model

pub struct Model {
    pub node_id: String,
    pub library_id: String,
    pub created_at: String,
    pub incarnation: String,
    pub heartbeat_at: String,
    pub software_version: String,
    pub schema_state: String,
    pub compatible: i64,
    pub logical_cpus: Option<i64>,
    pub cpu_max_quota_us: Option<i64>,
    pub cpu_max_period_us: Option<i64>,
    pub memory_max_bytes: Option<i64>,
    pub memory_current_bytes: Option<i64>,
    pub memory_anon_bytes: Option<i64>,
    pub files_dir_free_bytes: Option<i64>,
    pub scratch_bytes: Option<i64>,
    pub target: String,
    pub labels_json: String,
    pub kind: String,
    pub owner_user_id: Option<i64>,
    pub share_books: Option<i64>,
    pub include_branches: Option<i64>,
    pub catalog_fence: i64,
    pub catalog_cursor: String,
    pub catalog_pass_started_at: Option<String>,
    pub catalog_synced_at: Option<String>,
    pub catalog_full_pass_at: Option<String>,
    pub acquire_members_books: i64,
}

Row shape for one Bookclerk node in the library.

Fields

  • node_id: Stable node identifier. Not derived from hostname.
  • library_id: Library this node enrolled into.
  • created_at: RFC 3339 timestamp of the first successful registration.
  • incarnation: Latest process incarnation observed for this node.
  • heartbeat_at: RFC 3339 timestamp of the latest heartbeat.
  • software_version: Bookclerk version string reported by the latest heartbeat.
  • schema_state: Schema state display reported by the latest heartbeat.
  • compatible: 1 when the reporting binary accepted the library schema.
  • logical_cpus: available_parallelism, empty when the probe failed.
  • cpu_max_quota_us: Process cgroup cpu.max quota in microseconds. Empty when unlimited or missing.
  • cpu_max_period_us: Process cgroup cpu.max period in microseconds. Empty when unlimited or missing.
  • memory_max_bytes: Process cgroup memory.max in bytes. Empty when unlimited or missing.
  • memory_current_bytes: Process cgroup memory.current in bytes.
  • memory_anon_bytes: Process cgroup memory.stat field anon.
  • files_dir_free_bytes: Free bytes on the filesystem that holds $BOOKCLERK_FILES_DIR.
  • scratch_bytes: Byte size of the acquire scratch tree under the download cache.
  • target: Bookclerk artifact target of the reporting binary (linux-x64-gnu, …).
  • labels_json: JSON array of operator-assigned placement labels.
  • kind: owner (shares the database and master.key) or host (its own database, enrolled to contribute).
  • owner_user_id: User who owns this node and may administer it, when one is assigned.
  • share_books: For a branch (branch node): "Share this branch's books with library" as the branch last reported it (catalog.begin); empty until then.
  • include_branches: For a branch: "Include books from my own branches", as reported.
  • catalog_fence: The branch's catalog fence; catalog.* frames under another are lost.
  • catalog_cursor: Cursor the branch's catalog sync resumes after.
  • catalog_pass_started_at: RFC 3339 start of the branch's current full catalog pass.
  • catalog_synced_at: RFC 3339 time of the branch's last accepted catalog batch.
  • catalog_full_pass_at: RFC 3339 end of the branch's last completed full catalog pass.
  • acquire_members_books: For a branch: this library's "Acquire all of this branch's members' books" (1 = on), set by its operator. While on, the branch's catalog sync also sends the books its members acquired that it lists to this library (catalog.session.members_books).

Model::into_ex

pub fn into_ex(self) -> Self

Generated by sea-orm-macros

Implements: Clone, Debug, Eq, From<Model>, FromQueryResult, IntoActiveModel<ActiveModel>, ModelTrait, PartialEq, TryFrom<ActiveModel>, TryIntoModel<Model>

ColumnIter

pub struct ColumnIter {
    /* private fields */
}

An iterator over the variants of Column

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

Entity

pub struct Entity;

Generated by sea-orm-macros

Implements: Clone, Copy, Debug, Default, EntityName, EntityTrait, Iden, IdenStatic

PrimaryKeyIter

pub struct PrimaryKeyIter {
    /* private fields */
}

An iterator over the variants of PrimaryKey

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

ActiveModel

pub struct ActiveModel {
    pub node_id: ActiveValue<String>,
    pub library_id: ActiveValue<String>,
    pub created_at: ActiveValue<String>,
    pub incarnation: ActiveValue<String>,
    pub heartbeat_at: ActiveValue<String>,
    pub software_version: ActiveValue<String>,
    pub schema_state: ActiveValue<String>,
    pub compatible: ActiveValue<i64>,
    pub logical_cpus: ActiveValue<Option<i64>>,
    pub cpu_max_quota_us: ActiveValue<Option<i64>>,
    pub cpu_max_period_us: ActiveValue<Option<i64>>,
    pub memory_max_bytes: ActiveValue<Option<i64>>,
    pub memory_current_bytes: ActiveValue<Option<i64>>,
    pub memory_anon_bytes: ActiveValue<Option<i64>>,
    pub files_dir_free_bytes: ActiveValue<Option<i64>>,
    pub scratch_bytes: ActiveValue<Option<i64>>,
    pub target: ActiveValue<String>,
    pub labels_json: ActiveValue<String>,
    pub kind: ActiveValue<String>,
    pub owner_user_id: ActiveValue<Option<i64>>,
    pub share_books: ActiveValue<Option<i64>>,
    pub include_branches: ActiveValue<Option<i64>>,
    pub catalog_fence: ActiveValue<i64>,
    pub catalog_cursor: ActiveValue<String>,
    pub catalog_pass_started_at: ActiveValue<Option<String>>,
    pub catalog_synced_at: ActiveValue<Option<String>>,
    pub catalog_full_pass_at: ActiveValue<Option<String>>,
    pub acquire_members_books: ActiveValue<i64>,
}

Generated by sea-orm-macros

Fields

  • node_id: Generated by sea-orm-macros
  • library_id: Generated by sea-orm-macros
  • created_at: Generated by sea-orm-macros
  • incarnation: Generated by sea-orm-macros
  • heartbeat_at: Generated by sea-orm-macros
  • software_version: Generated by sea-orm-macros
  • schema_state: Generated by sea-orm-macros
  • compatible: Generated by sea-orm-macros
  • logical_cpus: Generated by sea-orm-macros
  • cpu_max_quota_us: Generated by sea-orm-macros
  • cpu_max_period_us: Generated by sea-orm-macros
  • memory_max_bytes: Generated by sea-orm-macros
  • memory_current_bytes: Generated by sea-orm-macros
  • memory_anon_bytes: Generated by sea-orm-macros
  • files_dir_free_bytes: Generated by sea-orm-macros
  • scratch_bytes: Generated by sea-orm-macros
  • target: Generated by sea-orm-macros
  • labels_json: Generated by sea-orm-macros
  • kind: Generated by sea-orm-macros
  • owner_user_id: Generated by sea-orm-macros
  • share_books: Generated by sea-orm-macros
  • include_branches: Generated by sea-orm-macros
  • catalog_fence: Generated by sea-orm-macros
  • catalog_cursor: Generated by sea-orm-macros
  • catalog_pass_started_at: Generated by sea-orm-macros
  • catalog_synced_at: Generated by sea-orm-macros
  • catalog_full_pass_at: Generated by sea-orm-macros
  • acquire_members_books: Generated by sea-orm-macros

Implements: ActiveModelBehavior, ActiveModelTrait, Clone, Debug, Default, From<Model>, IntoActiveModel<ActiveModel>, PartialEq, TryFrom<ActiveModel>, TryIntoModel<Model>

RelationIter

pub struct RelationIter {
    /* private fields */
}

An iterator over the variants of Relation

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

Enums

Column

pub enum Column {
    NodeId,
    LibraryId,
    CreatedAt,
    Incarnation,
    HeartbeatAt,
    SoftwareVersion,
    SchemaState,
    Compatible,
    LogicalCpus,
    CpuMaxQuotaUs,
    CpuMaxPeriodUs,
    MemoryMaxBytes,
    MemoryCurrentBytes,
    MemoryAnonBytes,
    FilesDirFreeBytes,
    ScratchBytes,
    Target,
    LabelsJson,
    Kind,
    OwnerUserId,
    ShareBooks,
    IncludeBranches,
    CatalogFence,
    CatalogCursor,
    CatalogPassStartedAt,
    CatalogSyncedAt,
    CatalogFullPassAt,
    AcquireMembersBooks,
}

Generated by sea-orm-macros

Variants

  • NodeId: Generated by sea-orm-macros
  • LibraryId: Generated by sea-orm-macros
  • CreatedAt: Generated by sea-orm-macros
  • Incarnation: Generated by sea-orm-macros
  • HeartbeatAt: Generated by sea-orm-macros
  • SoftwareVersion: Generated by sea-orm-macros
  • SchemaState: Generated by sea-orm-macros
  • Compatible: Generated by sea-orm-macros
  • LogicalCpus: Generated by sea-orm-macros
  • CpuMaxQuotaUs: Generated by sea-orm-macros
  • CpuMaxPeriodUs: Generated by sea-orm-macros
  • MemoryMaxBytes: Generated by sea-orm-macros
  • MemoryCurrentBytes: Generated by sea-orm-macros
  • MemoryAnonBytes: Generated by sea-orm-macros
  • FilesDirFreeBytes: Generated by sea-orm-macros
  • ScratchBytes: Generated by sea-orm-macros
  • Target: Generated by sea-orm-macros
  • LabelsJson: Generated by sea-orm-macros
  • Kind: Generated by sea-orm-macros
  • OwnerUserId: Generated by sea-orm-macros
  • ShareBooks: Generated by sea-orm-macros
  • IncludeBranches: Generated by sea-orm-macros
  • CatalogFence: Generated by sea-orm-macros
  • CatalogCursor: Generated by sea-orm-macros
  • CatalogPassStartedAt: Generated by sea-orm-macros
  • CatalogSyncedAt: Generated by sea-orm-macros
  • CatalogFullPassAt: Generated by sea-orm-macros
  • AcquireMembersBooks: Generated by sea-orm-macros

Implements: Clone, ColumnTrait, Copy, Debug, FromStr, Iden, IdenStatic, IntoEnumIterator

PrimaryKey

pub enum PrimaryKey {
    NodeId,
}

Generated by sea-orm-macros

Variants

  • NodeId: Generated by sea-orm-macros

Implements: Clone, Copy, Debug, Iden, IdenStatic, IntoEnumIterator, PrimaryKeyToColumn, PrimaryKeyTrait

Relation

pub enum Relation {}

Declared SeaORM relations (nodes are addressed by node_id).

Implements: Clone, Copy, Debug, IntoEnumIterator, RelationTrait

Generated from crates/bookclerk-library at main · View as Markdown