Skip to content

Commit

Permalink
Apply fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
igalshilman committed Nov 22, 2024
1 parent 5d321d6 commit 6d99302
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
7 changes: 3 additions & 4 deletions crates/core/src/metadata_store/providers/objstore/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,10 @@ impl MetadataStore for Client {
precondition,
tx,
})
.map_err(|_| WriteError::Internal("Object store fetch channel ".into()))?;
.map_err(|_| WriteError::Internal("Object store channel ".into()))?;

rx.await.map_err(|_| {
WriteError::Internal("Object store fetch channel disconnected".to_string())
})?
rx.await
.map_err(|_| WriteError::Internal("Object store channel disconnected".to_string()))?
}

async fn delete(&self, key: ByteString, precondition: Precondition) -> Result<(), WriteError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ use rand::Rng;
use std::sync::Arc;
use std::time::Duration;

use anyhow::anyhow;
use bytestring::ByteString;
use tokio::time::Instant;
use restate_types::config::MetadataStoreClient;
use crate::metadata_store::providers::objstore::immutable_store::ImmutableStore;
use crate::metadata_store::providers::objstore::version_repository::{
VersionRepository, VersionRepositoryError,
};
use crate::metadata_store::{Precondition, ReadError, VersionedValue, WriteError};
use anyhow::anyhow;
use bytestring::ByteString;
use restate_types::config::MetadataStoreClient;
use restate_types::Version;
use tokio::time::Instant;

pub(crate) struct OptimisticLockingMetadataStoreBuilder {
pub(crate) version_repository: Arc<dyn VersionRepository>,
Expand Down Expand Up @@ -158,7 +158,10 @@ impl OptimisticLockingMetadataStore {
};

// make sure that the versions are incremental
assert_eq!(new_store.current_version(), current_store.store.current_version().next());
assert_eq!(
new_store.current_version(),
current_store.store.current_version().next()
);

let new_store_bytes = new_store.serialize().map_err(WriteError::Store)?;

Expand Down Expand Up @@ -195,7 +198,10 @@ impl OptimisticLockingMetadataStore {
Err(WriteError::Internal("retry count exhausted".to_string()))
}

pub(crate) async fn get(&mut self, key: ByteString) -> Result<Option<VersionedValue>, ReadError> {
pub(crate) async fn get(
&mut self,
key: ByteString,
) -> Result<Option<VersionedValue>, ReadError> {
let cached_store = self
.get_or_update_store()
.await
Expand Down

0 comments on commit 6d99302

Please sign in to comment.