pub struct FeatherWriter { /* private fields */ }Expand description
Manages multiple FeatherBuffers and handles encoding, rotation, and flushing to the object store.
The write() method is the single entry point for clients: they supply a data value (of generic type T)
and the manager encodes it (using T’s metadata via EncodeToRecordBatch), routes it by CatalogPathPrefix,
and writes it to the appropriate FileWriter. When a writer’s buffer is full or rotation criteria are met,
its contents are flushed to the object store and it is replaced.
Implementations§
Source§impl FeatherWriter
impl FeatherWriter
Sourcepub fn new(
base_path: String,
store: Arc<dyn ObjectStore>,
clock: Rc<RefCell<dyn Clock>>,
rotation_config: RotationConfig,
included_types: Option<HashSet<String>>,
per_instrument_types: Option<HashSet<String>>,
) -> Self
pub fn new( base_path: String, store: Arc<dyn ObjectStore>, clock: Rc<RefCell<dyn Clock>>, rotation_config: RotationConfig, included_types: Option<HashSet<String>>, per_instrument_types: Option<HashSet<String>>, ) -> Self
Creates a new FeatherWriter instance.
Sourcepub async fn write<T>(&mut self, data: T) -> Result<(), Box<dyn Error>>where
T: EncodeToRecordBatch + CatalogPathPrefix + 'static,
pub async fn write<T>(&mut self, data: T) -> Result<(), Box<dyn Error>>where
T: EncodeToRecordBatch + CatalogPathPrefix + 'static,
Writes a single data value.
This is the user entry point. The data is encoded into a RecordBatch and written to the appropriate FileWriter.
If the writer’s buffer reaches capacity or meets rotation criteria (based on the rotation configuration),
the FileWriter is flushed to the object store and replaced.
Auto Trait Implementations§
impl Freeze for FeatherWriter
impl !RefUnwindSafe for FeatherWriter
impl !Send for FeatherWriter
impl !Sync for FeatherWriter
impl Unpin for FeatherWriter
impl !UnwindSafe for FeatherWriter
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
§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>
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>
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