pub struct FileSystemContext { /* private fields */ }Expand description
Shared connection context for Goosefs filesystem operations.
A single FileSystemContext instance should be created per Goosefs cluster
and shared across all BaseFileSystem, GoosefsFileInStream, and
GoosefsFileWriter instances that connect to that cluster.
The context owns:
- One persistent gRPC channel to the Master
- One persistent gRPC channel to the WorkerManager service
- One
WorkerClientPoolshared across all readers and writers - One
WorkerRouterthat tracks live workers and routes block reads
Implementations§
Source§impl FileSystemContext
impl FileSystemContext
Sourcepub async fn connect(config: GoosefsConfig) -> Result<Arc<Self>>
pub async fn connect(config: GoosefsConfig) -> Result<Arc<Self>>
Build a FileSystemContext by connecting to the Goosefs cluster.
Establishes persistent connections to the Master and WorkerManager, fetches the initial worker list, and starts a background refresh task.
This is the only call that performs network I/O. All subsequent operations on the context are zero-cost Arc clones.
Sourcepub fn acquire_master(&self) -> Arc<MasterClient>
pub fn acquire_master(&self) -> Arc<MasterClient>
Return the shared MasterClient (zero-cost Arc clone).
Sourcepub fn acquire_worker_manager(&self) -> Arc<WorkerManagerClient>
pub fn acquire_worker_manager(&self) -> Arc<WorkerManagerClient>
Return the shared WorkerManagerClient (zero-cost Arc clone).
Sourcepub fn acquire_worker_pool(&self) -> Arc<WorkerClientPool>
pub fn acquire_worker_pool(&self) -> Arc<WorkerClientPool>
Return the shared WorkerClientPool (zero-cost Arc clone).
Sourcepub fn acquire_router(&self) -> Arc<WorkerRouter>
pub fn acquire_router(&self) -> Arc<WorkerRouter>
Return the shared WorkerRouter (zero-cost Arc clone).
Sourcepub fn acquire_inquire_client(&self) -> Arc<dyn MasterInquireClient>
pub fn acquire_inquire_client(&self) -> Arc<dyn MasterInquireClient>
Return the shared MasterInquireClient (zero-cost Arc clone).
Sourcepub fn config(&self) -> &GoosefsConfig
pub fn config(&self) -> &GoosefsConfig
Return the configuration used to build this context.
Sourcepub fn acquire_config_refresher(&self) -> Arc<ConfigRefresher>
pub fn acquire_config_refresher(&self) -> Arc<ConfigRefresher>
Return the shared ConfigRefresher (zero-cost Arc clone).
Use this to query the current transparent acceleration switch values or to trigger a config reload check.
Sourcepub fn refresh_transparent_acceleration_switch(
&self,
) -> TransparentAccelerationSwitch
pub fn refresh_transparent_acceleration_switch( &self, ) -> TransparentAccelerationSwitch
Refresh the transparent acceleration switch by reloading config if expired.
Convenience wrapper around ConfigRefresher::refresh_transparent_acceleration_switch().
Mirrors Java’s AbstractCompatibleFileSystem.refreshTransparentAccelerationSwitch().
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileSystemContext
impl !RefUnwindSafe for FileSystemContext
impl Send for FileSystemContext
impl Sync for FileSystemContext
impl Unpin for FileSystemContext
impl UnsafeUnpin for FileSystemContext
impl !UnwindSafe for FileSystemContext
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> 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> 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