refactor: remove PersistentLayerDesc::is_incremental

This commit is contained in:
Joonas Koivunen
2023-08-22 17:00:19 +03:00
parent bd332f824e
commit 97d1443ed9

View File

@@ -28,13 +28,8 @@ pub struct PersistentLayerDesc {
/// - For a frozen in-memory layer or a delta layer, this is a valid end bound.
/// - An image layer represents snapshot at one LSN, so end_lsn is always the snapshot LSN + 1
pub lsn_range: Range<Lsn>,
/// Whether this is a delta layer.
/// Whether this is a delta layer, and also, is this incremental.
pub is_delta: bool,
/// Does this layer only contain some data for the key-range (incremental),
/// or does it contain a version of every page? This is important to know
/// for garbage collecting old layers: an incremental layer depends on
/// the previous non-incremental layer.
pub is_incremental: bool,
/// File size
pub file_size: u64,
}
@@ -68,7 +63,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range: Lsn(0)..Lsn(1),
is_delta: false,
is_incremental: false,
file_size: 0,
}
}
@@ -86,8 +80,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range: Self::image_layer_lsn_range(lsn),
is_delta: false,
// currently all image layers are non-incremental
is_incremental: false,
file_size,
}
}
@@ -105,7 +97,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range,
is_delta: true,
is_incremental: true,
file_size,
}
}
@@ -171,8 +162,12 @@ impl PersistentLayerDesc {
self.tenant_id
}
/// Does this layer only contain some data for the key-range (incremental),
/// or does it contain a version of every page? This is important to know
/// for garbage collecting old layers: an incremental layer depends on
/// the previous non-incremental layer.
pub fn is_incremental(&self) -> bool {
self.is_incremental
self.is_delta
}
pub fn is_delta(&self) -> bool {