LCOV - differential code coverage report
Current view: top level - libs/safekeeper_api/src - models.rs (source / functions) Coverage Total Hit UBC CBC
Current: cd44433dd675caa99df17a61b18949c8387e2242.info Lines: 100.0 % 6 6 6
Current Date: 2024-01-09 02:06:09 Functions: 26.0 % 50 13 37 13
Baseline: 66c52a629a0f4a503e193045e0df4c77139e344b.info
Baseline Date: 2024-01-08 15:34:46

           TLA  Line data    Source code
       1                 : use serde::{Deserialize, Serialize};
       2                 : 
       3                 : use utils::{
       4                 :     id::{NodeId, TenantId, TimelineId},
       5                 :     lsn::Lsn,
       6                 : };
       7                 : 
       8 CBC          27 : #[derive(Serialize, Deserialize)]
       9                 : pub struct TimelineCreateRequest {
      10                 :     pub tenant_id: TenantId,
      11                 :     pub timeline_id: TimelineId,
      12                 :     pub peer_ids: Option<Vec<NodeId>>,
      13                 :     pub pg_version: u32,
      14                 :     pub system_id: Option<u64>,
      15                 :     pub wal_seg_size: Option<u32>,
      16                 :     pub commit_lsn: Lsn,
      17                 :     // If not passed, it is assigned to the beginning of commit_lsn segment.
      18                 :     pub local_start_lsn: Option<Lsn>,
      19                 : }
      20                 : 
      21              15 : fn lsn_invalid() -> Lsn {
      22              15 :     Lsn::INVALID
      23              15 : }
      24                 : 
      25                 : /// Data about safekeeper's timeline, mirrors broker.proto.
      26               9 : #[derive(Debug, Clone, Deserialize, Serialize)]
      27                 : pub struct SkTimelineInfo {
      28                 :     /// Term.
      29                 :     pub term: Option<u64>,
      30                 :     /// Term of the last entry.
      31                 :     pub last_log_term: Option<u64>,
      32                 :     /// LSN of the last record.
      33                 :     #[serde(default = "lsn_invalid")]
      34                 :     pub flush_lsn: Lsn,
      35                 :     /// Up to which LSN safekeeper regards its WAL as committed.
      36                 :     #[serde(default = "lsn_invalid")]
      37                 :     pub commit_lsn: Lsn,
      38                 :     /// LSN up to which safekeeper has backed WAL.
      39                 :     #[serde(default = "lsn_invalid")]
      40                 :     pub backup_lsn: Lsn,
      41                 :     /// LSN of last checkpoint uploaded by pageserver.
      42                 :     #[serde(default = "lsn_invalid")]
      43                 :     pub remote_consistent_lsn: Lsn,
      44                 :     #[serde(default = "lsn_invalid")]
      45                 :     pub peer_horizon_lsn: Lsn,
      46                 :     #[serde(default = "lsn_invalid")]
      47                 :     pub local_start_lsn: Lsn,
      48                 :     /// A connection string to use for WAL receiving.
      49                 :     #[serde(default)]
      50                 :     pub safekeeper_connstr: Option<String>,
      51                 :     #[serde(default)]
      52                 :     pub http_connstr: Option<String>,
      53                 : }
      54                 : 
      55             240 : #[derive(Debug, Clone, Deserialize, Serialize)]
      56                 : pub struct TimelineCopyRequest {
      57                 :     pub target_timeline_id: TimelineId,
      58                 :     pub until_lsn: Lsn,
      59                 : }
        

Generated by: LCOV version 2.1-beta