remove Layer::get_lsn_range, all unused impls

This commit is contained in:
Joonas Koivunen
2023-08-22 00:31:16 +03:00
parent ddd4752c43
commit ecd13404ab
5 changed files with 2 additions and 28 deletions

View File

@@ -344,14 +344,6 @@ impl LayerAccessStats {
/// are used in (timeline).
#[async_trait::async_trait]
pub trait Layer: std::fmt::Debug + std::fmt::Display + Send + Sync + 'static {
/// Inclusive start bound of the LSN range that this layer holds
/// Exclusive end bound of the LSN range that this layer holds.
///
/// - For an open in-memory layer, this is MAX_LSN.
/// - 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
fn get_lsn_range(&self) -> Range<Lsn>;
/// 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

View File

@@ -255,10 +255,6 @@ impl Layer for DeltaLayer {
.await
}
fn get_lsn_range(&self) -> Range<Lsn> {
self.get_lsn_range()
}
fn is_incremental(&self) -> bool {
self.is_incremental()
}

View File

@@ -186,11 +186,6 @@ impl Layer for ImageLayer {
.await
}
/// Boilerplate to implement the Layer trait, always use layer_desc for persistent layers.
fn get_lsn_range(&self) -> Range<Lsn> {
self.get_lsn_range()
}
/// Boilerplate to implement the Layer trait, always use layer_desc for persistent layers.
fn is_incremental(&self) -> bool {
self.is_incremental()

View File

@@ -218,10 +218,6 @@ impl InMemoryLayer {
#[async_trait::async_trait]
impl Layer for InMemoryLayer {
fn get_lsn_range(&self) -> Range<Lsn> {
self.get_lsn_range()
}
fn is_incremental(&self) -> bool {
self.is_incremental()
}

View File

@@ -95,11 +95,6 @@ impl Layer for RemoteLayer {
Ok(())
}
/// Boilerplate to implement the Layer trait, always use layer_desc for persistent layers.
fn get_lsn_range(&self) -> Range<Lsn> {
self.layer_desc().lsn_range.clone()
}
/// Boilerplate to implement the Layer trait, always use layer_desc for persistent layers.
fn is_incremental(&self) -> bool {
self.layer_desc().is_incremental
@@ -137,8 +132,8 @@ impl PersistentLayer for RemoteLayer {
}
fn info(&self, reset: LayerAccessStatsReset) -> HistoricLayerInfo {
let layer_file_name = self.filename().file_name();
let lsn_range = self.get_lsn_range();
let layer_file_name = self.layer_desc().filename().file_name();
let lsn_range = self.layer_desc().lsn_range.clone();
if self.desc.is_delta {
HistoricLayerInfo::Delta {