Refactor ExecServer filesystem split between local and remote (#15232)

For each feature we have:
1. Trait exposed on environment
2. **Local Implementation** of the trait
3. Remote implementation that uses the client to proxy via network
4. Handler implementation that handles PRC requests and calls into
**Local Implementation**
This commit is contained in:
pakrym-oai
2026-03-19 17:08:04 -07:00
committed by GitHub
parent 6b8175c734
commit 403b397e4e
15 changed files with 660 additions and 105 deletions

View File

@@ -1,8 +1,10 @@
use crate::ExecServerClient;
use crate::ExecServerError;
use crate::RemoteExecServerConnectArgs;
use crate::fs;
use crate::fs::ExecutorFileSystem;
use crate::file_system::ExecutorFileSystem;
use crate::local_file_system::LocalFileSystem;
use crate::remote_file_system::RemoteFileSystem;
use std::sync::Arc;
#[derive(Clone, Default)]
pub struct Environment {
@@ -56,8 +58,12 @@ impl Environment {
self.remote_exec_server_client.as_ref()
}
pub fn get_filesystem(&self) -> impl ExecutorFileSystem + use<> {
fs::LocalFileSystem
pub fn get_filesystem(&self) -> Arc<dyn ExecutorFileSystem> {
if let Some(client) = self.remote_exec_server_client.clone() {
Arc::new(RemoteFileSystem::new(client))
} else {
Arc::new(LocalFileSystem)
}
}
}