pub struct DiskBuffer {
pub max_size_bytes: Option<u64>,
pub current_size_bytes: u64,
/* private fields */
}Expand description
A persistent buffer that stores Arrow batches on disk.
Fields§
§max_size_bytes: Option<u64>§current_size_bytes: u64Implementations§
Source§impl DiskBuffer
impl DiskBuffer
Sourcepub fn new<P: AsRef<Path>>(
data_dir: P,
component_id: String,
max_size_bytes: Option<u64>,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( data_dir: P, component_id: String, max_size_bytes: Option<u64>, ) -> Result<Self>
Creates a new DiskBuffer or loads existing state from disk.
Sourcepub fn enqueue(&mut self, batch: &EventBatch) -> Result<()>
pub fn enqueue(&mut self, batch: &EventBatch) -> Result<()>
Enqueues a batch to disk.
Sourcepub fn dequeue(&mut self) -> Result<Option<EventBatch>>
pub fn dequeue(&mut self) -> Result<Option<EventBatch>>
Dequeues the next batch from disk.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for DiskBuffer
impl RefUnwindSafe for DiskBuffer
impl Send for DiskBuffer
impl Sync for DiskBuffer
impl Unpin for DiskBuffer
impl UnsafeUnpin for DiskBuffer
impl UnwindSafe for DiskBuffer
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