Skip to content

Commit

Permalink
Move trait impls inline
Browse files Browse the repository at this point in the history
  • Loading branch information
jkosh44 committed Sep 17, 2023
1 parent 553fce7 commit 3bab154
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 500 deletions.
4 changes: 2 additions & 2 deletions src/adapter/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3624,7 +3624,7 @@ impl Catalog {
if !storage.is_read_only() {
// IMPORTANT: we durably record the new timestamp before using it.
storage
.persist_timestamp(&Timeline::EpochMilliseconds, boot_ts)
.set_timestamp(&Timeline::EpochMilliseconds, boot_ts)
.await?;
}

Expand Down Expand Up @@ -5336,7 +5336,7 @@ impl Catalog {
) -> Result<(), Error> {
self.storage()
.await
.persist_timestamp(timeline, timestamp)
.set_timestamp(timeline, timestamp)
.await
.err_into()
}
Expand Down
9 changes: 5 additions & 4 deletions src/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct BootstrapArgs {
#[async_trait]
pub trait ReadOnlyDurableCatalogState: Debug + Send {
/// Reports if the catalog state has been initialized.
async fn is_initialized(&self) -> Result<bool, Error>;
async fn is_initialized(&mut self) -> Result<bool, Error>;

// TODO(jkosh44) add and implement open methods to be implementation agnostic.
/* /// Checks to see if opening the catalog would be
Expand Down Expand Up @@ -289,8 +289,9 @@ pub trait ReadOnlyDurableCatalogState: Debug + Send {
self.get_next_id(USER_REPLICA_ID_ALLOC_KEY).await
}

/// Dumps the entire catalog contents in human readable JSON.
async fn dump(&self) -> Result<String, Error>;
// TODO(jkosh44) Implement this for the catalog debug tool.
/* /// Dumps the entire catalog contents in human readable JSON.
async fn dump(&self) -> Result<String, Error>;*/
}

/// A read-write API for the durable catalog state.
Expand Down Expand Up @@ -351,7 +352,7 @@ pub trait DurableCatalogState: ReadOnlyDurableCatalogState {
) -> Result<(), Error>;

/// Persist new global timestamp for a timeline.
async fn persist_timestamp(
async fn set_timestamp(
&mut self,
timeline: &Timeline,
timestamp: mz_repr::Timestamp,
Expand Down
Loading

0 comments on commit 3bab154

Please sign in to comment.