Skip to main content

DiskManager

Struct DiskManager 

Source
pub struct DiskManager { /* private fields */ }
Expand description

Manages files generated during query execution, e.g. spill files generated while processing dataset larger than available memory.

Implementations§

Source§

impl DiskManager

Source

pub fn builder() -> DiskManagerBuilder

Creates a builder for DiskManager

Source

pub fn set_max_temp_directory_size( &self, max_temp_directory_size: u64, ) -> Result<()>

Atomically set the max temp directory size at runtime.

Takes &self, so it works through Arc<DiskManager> without requiring exclusive access. Takes effect immediately for subsequent spill writes.

Use this when you need to adjust the limit dynamically while queries are running (e.g., adapting to available disk space).

Source

pub fn set_arc_max_temp_directory_size( this: &Arc<Self>, max_temp_directory_size: u64, ) -> Result<()>

👎Deprecated since 54.0.0:

Use set_max_temp_directory_size directly, it now takes &self

Source

pub fn with_max_temp_directory_size( self, max_temp_directory_size: u64, ) -> Result<Self>

Source

pub fn used_disk_space(&self) -> u64

Source

pub fn max_temp_directory_size(&self) -> u64

Returns the maximum temporary directory size in bytes

Source

pub fn set_max_spill_merge_fan_in(&self, max_spill_merge_fan_in: usize)

Atomically set the maximum spill merge fan-in.

A value of 0 disables the cap. Values of 1 are accepted but external merge code will still merge at least two spill streams to make progress.

Source

pub fn max_spill_merge_fan_in(&self) -> usize

Returns the maximum number of spill files opened by one merge pass.

A value of 0 means unlimited.

Source

pub fn spilling_progress(&self) -> SpillingProgress

Returns the current spilling progress

Source

pub fn temp_dir_paths(&self) -> Vec<PathBuf>

Returns the temporary directory paths

Source

pub fn tmp_files_enabled(&self) -> bool

Return true if this disk manager supports creating temporary files. If this returns false, any call to create_tmp_file will error.

Source

pub fn create_tmp_file( self: &Arc<Self>, request_description: &str, ) -> Result<Arc<dyn SpillFile>>

Return a temporary file from a randomized choice in the configured locations

If the file can not be created for some reason, returns an error message referencing the request description

Trait Implementations§

Source§

impl Debug for DiskManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V