pub struct ObjectStoreDirectoryService {
instance_name: String,
object_store: Arc<dyn ObjectStore>,
base_path: Path,
}
Expand description
Stores directory closures in an object store.
Notably, this makes use of the option to disallow accessing child directories except when
fetching them recursively via the top-level directory, since all batched writes
(using put_multiple_start
) are stored in a single object.
Directories are stored in a length-delimited format with a 1MiB limit. The length field is a
u32 and the directories are stored in root-to-leaves topological order, the same way they will
be returned to the client in get_recursive.
Fields§
§instance_name: String
§object_store: Arc<dyn ObjectStore>
§base_path: Path
Implementations§
source§impl ObjectStoreDirectoryService
impl ObjectStoreDirectoryService
sourcepub fn parse_url_opts<I, K, V>(url: &Url, options: I) -> Result<Self, Error>
pub fn parse_url_opts<I, K, V>(url: &Url, options: I) -> Result<Self, Error>
Constructs a new ObjectStoreDirectoryService from a Url supported by object_store. Any path suffix becomes the base path of the object store. additional options, the same as in object_store::parse_url_opts can be passed.
sourcepub fn parse_url(url: &Url) -> Result<Self, Error>
pub fn parse_url(url: &Url) -> Result<Self, Error>
Like Self::parse_url_opts, except without the options.
pub fn new( instance_name: String, object_store: Arc<dyn ObjectStore>, base_path: Path, ) -> Self
Trait Implementations§
source§impl Clone for ObjectStoreDirectoryService
impl Clone for ObjectStoreDirectoryService
source§fn clone(&self) -> ObjectStoreDirectoryService
fn clone(&self) -> ObjectStoreDirectoryService
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl DirectoryService for ObjectStoreDirectoryService
impl DirectoryService for ObjectStoreDirectoryService
source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<Option<Directory>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<Option<Directory>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
This is the same steps as for get_recursive anyways, so we just call get_recursive and return the first element of the stream and drop the request.
source§fn put<'life0, 'async_trait>(
&'life0 self,
directory: Directory,
) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
directory: Directory,
) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§fn get_recursive(
&self,
root_directory_digest: &B3Digest,
) -> BoxStream<'static, Result<Directory, Error>>
fn get_recursive( &self, root_directory_digest: &B3Digest, ) -> BoxStream<'static, Result<Directory, Error>>
source§fn put_multiple_start(&self) -> Box<dyn DirectoryPutter + 'static>where
Self: Clone,
fn put_multiple_start(&self) -> Box<dyn DirectoryPutter + 'static>where
Self: Clone,
Auto Trait Implementations§
impl Freeze for ObjectStoreDirectoryService
impl !RefUnwindSafe for ObjectStoreDirectoryService
impl Send for ObjectStoreDirectoryService
impl Sync for ObjectStoreDirectoryService
impl Unpin for ObjectStoreDirectoryService
impl !UnwindSafe for ObjectStoreDirectoryService
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request