xudong963 commented on code in PR #22246:
URL: https://github.com/apache/datafusion/pull/22246#discussion_r3254036703
##########
datafusion/execution/src/disk_manager.rs:
##########
@@ -245,10 +270,10 @@ impl DiskManager {
max_temp_directory_size: u64,
) -> Result<()> {
if let Some(inner) = Arc::get_mut(this) {
- inner.set_max_temp_directory_size(max_temp_directory_size)?;
- Ok(())
+ inner.set_max_temp_directory_size(max_temp_directory_size)
} else {
- config_err!("DiskManager should be a single instance")
+ // No exclusive access — use the atomic path
+ this.update_max_temp_directory_size(max_temp_directory_size)
}
}
Review Comment:
let's collapse `set_arc_max_temp_directory_size`. Both branches now do the
same thing. Replace the body with:
```rust
this.update_max_temp_directory_size(max_temp_directory_size)
```
and add `#[deprecated(note = "use update_max_temp_directory_size")]`. The
`Arc::get_mut` dance no longer serves any purpose.
```
#[deprecated(note = "use `update_max_temp_directory_size` instead")]
pub fn set_arc_max_temp_directory_size(
this: &Arc<Self>,
max_temp_directory_size: u64,
) -> Result<()> {
this.update_max_temp_directory_size(max_temp_directory_size)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]