pub struct InProgressSpillFile {
pub(crate) spill_writer: Arc<SpillManager>,
writer: Option<IPCStreamWriter>,
in_progress_file: Option<RefCountedTempFile>,
}Expand description
Represents an in-progress spill file used for writing RecordBatches to disk, created by SpillManager.
Caller is able to use this struct to incrementally append in-memory batches to
the file, and then finalize the file by calling the finish method.
Fields§
§spill_writer: Arc<SpillManager>§writer: Option<IPCStreamWriter>Lazily initialized writer
in_progress_file: Option<RefCountedTempFile>Lazily initialized in-progress file, it will be moved out when the finish method is invoked
Implementations§
Source§impl InProgressSpillFile
impl InProgressSpillFile
pub fn new( spill_writer: Arc<SpillManager>, in_progress_file: RefCountedTempFile, ) -> Self
Sourcepub fn append_batch(&mut self, batch: &RecordBatch) -> Result<()>
pub fn append_batch(&mut self, batch: &RecordBatch) -> Result<()>
Appends a RecordBatch to the spill file, initializing the writer if necessary.
§Errors
- Returns an error if the file is not active (has been finalized)
- Returns an error if appending would exceed the disk usage limit configured
by
max_temp_directory_sizeinDiskManager
Auto Trait Implementations§
impl Freeze for InProgressSpillFile
impl !RefUnwindSafe for InProgressSpillFile
impl Send for InProgressSpillFile
impl Sync for InProgressSpillFile
impl Unpin for InProgressSpillFile
impl !UnwindSafe for InProgressSpillFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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