Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions datafusion/core/src/datasource/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ pub trait ObjectStoreProvider: Send + Sync + 'static {
}

/// Object store registry
#[derive(Clone)]
pub struct ObjectStoreRegistry {
/// A map from scheme to object store that serve list / read operations for the store
object_stores: Arc<RwLock<HashMap<String, Arc<dyn ObjectStore>>>>,
object_stores: RwLock<HashMap<String, Arc<dyn ObjectStore>>>,
provider: Option<Arc<dyn ObjectStoreProvider>>,
}

Expand Down Expand Up @@ -125,7 +124,7 @@ impl ObjectStoreRegistry {
let mut map: HashMap<String, Arc<dyn ObjectStore>> = HashMap::new();
map.insert("file://".to_string(), Arc::new(LocalFileSystem::new()));
Self {
object_stores: Arc::new(RwLock::new(map)),
object_stores: RwLock::new(map),
provider,
}
}
Expand Down
6 changes: 3 additions & 3 deletions datafusion/core/src/execution/runtime_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl RuntimeEnv {
Ok(Self {
memory_manager: MemoryManager::new(memory_manager),
disk_manager: DiskManager::try_new(disk_manager)?,
object_store_registry: Arc::new(object_store_registry),
object_store_registry,
})
}

Expand Down Expand Up @@ -123,7 +123,7 @@ pub struct RuntimeConfig {
/// MemoryManager to limit access to memory
pub memory_manager: MemoryManagerConfig,
/// ObjectStoreRegistry to get object store based on url
pub object_store_registry: ObjectStoreRegistry,
pub object_store_registry: Arc<ObjectStoreRegistry>,
}

impl RuntimeConfig {
Expand All @@ -147,7 +147,7 @@ impl RuntimeConfig {
/// Customize object store registry
pub fn with_object_store_registry(
mut self,
object_store_registry: ObjectStoreRegistry,
object_store_registry: Arc<ObjectStoreRegistry>,
) -> Self {
self.object_store_registry = object_store_registry;
self
Expand Down