Skip to content

Commit

Permalink
Merge remote-tracking branch 'n0/main' into gen-api
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Aug 21, 2024
2 parents faeb6d3 + c70caaf commit 7cd3cf9
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 567 deletions.
41 changes: 1 addition & 40 deletions iroh-blobs/src/store/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ use smallvec::SmallVec;
use tokio::io::AsyncWriteExt;
use tracing::trace_span;

mod import_flat_store;
mod migrate_redb_v1_v2;
mod tables;
#[doc(hidden)]
Expand Down Expand Up @@ -586,11 +585,6 @@ pub(crate) enum ActorMessage {
cmd: Export,
tx: oneshot::Sender<ActorResult<()>>,
},
/// Modification method: import an entire flat store into the redb store.
ImportFlatStore {
paths: FlatStorePaths,
tx: oneshot::Sender<bool>,
},
/// Update inline options
UpdateInlineOptions {
/// The new inline options
Expand Down Expand Up @@ -680,8 +674,7 @@ impl ActorMessage {
Self::UpdateInlineOptions { .. }
| Self::Sync { .. }
| Self::Shutdown { .. }
| Self::Fsck { .. }
| Self::ImportFlatStore { .. } => MessageCategory::TopLevel,
| Self::Fsck { .. } => MessageCategory::TopLevel,
#[cfg(test)]
Self::EntryState { .. } => MessageCategory::ReadOnly,
}
Expand All @@ -698,17 +691,6 @@ enum MessageCategory {
pub(crate) type FilterPredicate<K, V> =
Box<dyn Fn(u64, AccessGuard<K>, AccessGuard<V>) -> Option<(K, V)> + Send + Sync>;

/// Parameters for importing from a flat store
#[derive(Debug)]
pub struct FlatStorePaths {
/// Complete data files
pub complete: PathBuf,
/// Partial data files
pub partial: PathBuf,
/// Metadata files such as the tags table
pub meta: PathBuf,
}

/// Storage that is using a redb database for small files and files for
/// large files.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -756,15 +738,6 @@ impl Store {
pub async fn dump(&self) -> io::Result<()> {
Ok(self.0.dump().await?)
}

/// Import from a v0 or v1 flat store, for backwards compatibility.
#[deprecated(
since = "0.23.0",
note = "Flat stores are deprecated and future versions will not be able to migrate."
)]
pub async fn import_flat_store(&self, paths: FlatStorePaths) -> io::Result<bool> {
Ok(self.0.import_flat_store(paths).await?)
}
}

#[derive(Debug)]
Expand Down Expand Up @@ -1001,14 +974,6 @@ impl StoreInner {
Ok(rx.await??)
}

async fn import_flat_store(&self, paths: FlatStorePaths) -> OuterResult<bool> {
let (tx, rx) = oneshot::channel();
self.tx
.send(ActorMessage::ImportFlatStore { paths, tx })
.await?;
Ok(rx.await?)
}

async fn update_inline_options(
&self,
inline_options: InlineOptions,
Expand Down Expand Up @@ -2193,10 +2158,6 @@ impl ActorState {

fn handle_toplevel(&mut self, db: &redb::Database, msg: ActorMessage) -> ActorResult<()> {
match msg {
ActorMessage::ImportFlatStore { paths, tx } => {
let res = self.import_flat_store(db, paths);
tx.send(res?).ok();
}
ActorMessage::UpdateInlineOptions {
inline_options,
reapply,
Expand Down
Loading

0 comments on commit 7cd3cf9

Please sign in to comment.