Build the runtime environment, optionally wrapping the local filesystem with a throttled object store to simulate remote storage latency.
(&self)
| 135 | /// Build the runtime environment, optionally wrapping the local filesystem |
| 136 | /// with a throttled object store to simulate remote storage latency. |
| 137 | pub fn build_runtime(&self) -> Result<Arc<RuntimeEnv>> { |
| 138 | let rt = self.runtime_env_builder()?.build_arc()?; |
| 139 | if self.simulate_latency { |
| 140 | let store: Arc<dyn object_store::ObjectStore> = |
| 141 | Arc::new(LatencyObjectStore::new(LocalFileSystem::new())); |
| 142 | let url = ObjectStoreUrl::parse("file:///")?; |
| 143 | rt.register_object_store(url.as_ref(), store); |
| 144 | println!( |
| 145 | "Simulating S3-like object store latency (get: 25-200ms, list: 40-400ms)" |
| 146 | ); |
| 147 | } |
| 148 | Ok(rt) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | /// Parse capacity limit from string to number of bytes by allowing units: K, M and G. |
no test coverage detected