Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions core/crates/layerfs-history/src/contract/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::identity::{BranchId, CatalogId, CommitId, HistoryName, LayerId, Layer
use crate::records::{
AddLayerOutcome, AddLayerRequest, BranchMergeRequest, BranchRecord, BranchSnapshot,
CommitHistoryRequest, CommitOutcome, CommitRecord, CommitRequest, ForkRequest,
LayerHistoryRequest, LayerRecord, LayerStackRecord, Page, PageResult, PathRemovalOutcome,
PathRemovalRecord, PathRemovalRequest, Reservation, ReserveRequest, StackInitialization,
LayerHistoryRequest, LayerRecord, LayerStackRecord, Page, PageResult, Reservation,
ReserveRequest, StackInitialization,
};
/// Checked inputs that establish one catalog binding.
#[derive(Clone, Eq, PartialEq)]
Expand Down Expand Up @@ -332,29 +332,6 @@ pub trait HistoryCatalog: Send + Sync {
))
}

/// Applies one `project.remove_file` marker in one write transaction:
/// reads the Store high-water as the new frontier, returns `UpToDate`
/// when the path's marker already covers every project node, otherwise
/// advances the marker and the project epoch. The default refuses.
fn remove_path(&self, _request: &PathRemovalRequest) -> HistoryResult<PathRemovalOutcome> {
Err(crate::error::HistoryError::Unsupported("path removal"))
}

/// Every `path_removed` marker of one Stack. The default refuses.
fn path_removals(&self, _stack: LayerStackId) -> HistoryResult<Vec<PathRemovalRecord>> {
Err(crate::error::HistoryError::Unsupported(
"path removal markers",
))
}

/// The `history_serial` a Commit or Layer records, if it exists. The
/// default refuses.
fn node_history_serial(&self, _node: NodeId) -> HistoryResult<Option<u64>> {
Err(crate::error::HistoryError::Unsupported(
"node history position",
))
}

/// The retained history roots of one Stack. The default refuses.
///
/// # Errors
Expand Down
3 changes: 0 additions & 3 deletions core/crates/layerfs-history/src/contract/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ pub enum HistoryError {
NameTaken(Box<NameTakenState>),
/// A path is hidden by `remove_file`.
Removed(Box<RemovedState>),
/// A required marker or fence row is missing or contradicts the request.
Conflict(&'static str),
/// The Store was replaced or moved under this handle.
StaleStore,
/// Immediate metadata admission was refused; the caller may retry later.
Expand Down Expand Up @@ -210,7 +208,6 @@ impl std::fmt::Display for HistoryError {
Self::Unsupported(what) => write!(formatter, "unsupported: {what}"),
Self::NameTaken(state) => write!(formatter, "name taken: {:?}", state.holder),
Self::Removed(state) => write!(formatter, "removed: {} paths", state.paths.len()),
Self::Conflict(what) => write!(formatter, "conflict: {what}"),
Self::StaleStore => formatter.write_str("stale Store"),
Self::Busy => formatter.write_str("busy"),
Self::OwnershipUnavailable => formatter.write_str("ownership unavailable"),
Expand Down
1 change: 0 additions & 1 deletion core/crates/layerfs-history/src/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
pub mod catalog;
pub mod error;
pub mod identity;
pub mod path;
pub mod query;
pub mod records;
154 changes: 0 additions & 154 deletions core/crates/layerfs-history/src/contract/path.rs

This file was deleted.

47 changes: 0 additions & 47 deletions core/crates/layerfs-history/src/contract/records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,50 +636,3 @@ pub struct InitStatistics {
/// Init's wall time in milliseconds, up to the first Branch.
pub millis: u64,
}

/// One `path_removed` marker as stored for a project.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PathRemovalRecord {
/// The normalized relative path the marker names.
pub path: Vec<u8>,
/// The Store high-water when the marker last advanced.
pub frontier_serial: u64,
/// When the marker last advanced, in milliseconds since the epoch.
pub removed_ms: i64,
}

/// Whether a `project.remove_file` call advanced the marker or found it current.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PathRemovalKind {
/// The marker advanced to a new frontier.
Removed,
/// No project node is above the marker's frontier; the stored values are returned.
UpToDate,
}

/// One `project.remove_file` request: the project, the normalized path and the
/// time the caller observed.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PathRemovalRequest {
/// Project (LayerStack) the path is removed in.
pub stack: LayerStackId,
/// The normalized relative path bytes; `BLAKE3` keys the marker.
pub path: Vec<u8>,
/// When the call was made, in milliseconds since the epoch.
pub removed_ms: i64,
}

/// One `project.remove_file` result: the stored marker values.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PathRemovalOutcome {
/// Whether the call advanced the marker or found it current.
pub kind: PathRemovalKind,
/// Project (LayerStack) the marker belongs to.
pub stack: LayerStackId,
/// The stored normalized relative path.
pub path: Vec<u8>,
/// The stored frontier serial.
pub frontier_serial: u64,
/// The stored `removed_ms`.
pub removed_ms: i64,
}
4 changes: 1 addition & 3 deletions core/crates/layerfs-history/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mod contract;
pub use contract::catalog;
pub use contract::error;
pub use contract::identity;
pub use contract::path;
pub use contract::query;
pub use contract::records;

Expand All @@ -35,7 +34,6 @@ pub use records::{
BranchSnapshot, CommitHistoryRequest, CommitMeta, CommitOutcome, CommitRecord, CommitRequest,
CommitStatistics, CommitVia, FileDigest, ForkRequest, ForkSource, InitStatistics,
LayerHistoryRequest, LayerRecord, LayerStackRecord, MergeCommit, MergeHead, MergeSide, Page,
PageResult, PathRemovalKind, PathRemovalOutcome, PathRemovalRecord, PathRemovalRequest,
RecordKind, Reservation, ReserveRequest, StackInitialization, StoreStatistics,
PageResult, RecordKind, Reservation, ReserveRequest, StackInitialization, StoreStatistics,
FILE_DIGEST_WINDOW, MAXIMUM_MESSAGE_BYTES, MAXIMUM_PAGE_RECORDS,
};
70 changes: 0 additions & 70 deletions core/crates/layerfs-history/tests/contract_constructors.rs

This file was deleted.

Loading
Loading