pub struct SerializedPageWriter<'a, W: Write> {
sink: &'a mut TrackedWrite<W>,
page_encryptor: Option<PageEncryptor>,
}
Expand description
A serialized implementation for Parquet PageWriter
.
Writes and serializes pages and metadata into output stream.
SerializedPageWriter
should not be used after calling close()
.
Fields§
§sink: &'a mut TrackedWrite<W>
§page_encryptor: Option<PageEncryptor>
Implementations§
Source§impl<'a, W: Write> SerializedPageWriter<'a, W>
impl<'a, W: Write> SerializedPageWriter<'a, W>
Sourcepub fn new(sink: &'a mut TrackedWrite<W>) -> Self
pub fn new(sink: &'a mut TrackedWrite<W>) -> Self
Creates new page writer.
Sourcefn serialize_page_header(&mut self, header: PageHeader) -> Result<usize>
fn serialize_page_header(&mut self, header: PageHeader) -> Result<usize>
Serializes page header into Thrift. Returns number of bytes that have been written into the sink.
Source§impl<'a, W: Write> SerializedPageWriter<'a, W>
impl<'a, W: Write> SerializedPageWriter<'a, W>
Sourcefn with_page_encryptor(self, page_encryptor: Option<PageEncryptor>) -> Self
fn with_page_encryptor(self, page_encryptor: Option<PageEncryptor>) -> Self
Set the encryptor to use to encrypt page data
fn page_encryptor_mut(&mut self) -> Option<&mut PageEncryptor>
fn page_encryptor_and_sink_mut( &mut self, ) -> Option<(&mut PageEncryptor, &mut &'a mut TrackedWrite<W>)>
Trait Implementations§
Source§impl<W: Write + Send> PageWriter for SerializedPageWriter<'_, W>
impl<W: Write + Send> PageWriter for SerializedPageWriter<'_, W>
Source§fn write_page(&mut self, page: CompressedPage) -> Result<PageWriteSpec>
fn write_page(&mut self, page: CompressedPage) -> Result<PageWriteSpec>
Writes a page into the output stream/sink.
Returns
PageWriteSpec
that contains information about written page metrics,
including number of bytes, size, number of values, offset, etc. Read moreAuto Trait Implementations§
impl<'a, W> Freeze for SerializedPageWriter<'a, W>
impl<'a, W> !RefUnwindSafe for SerializedPageWriter<'a, W>
impl<'a, W> Send for SerializedPageWriter<'a, W>where
W: Send,
impl<'a, W> Sync for SerializedPageWriter<'a, W>where
W: Sync,
impl<'a, W> Unpin for SerializedPageWriter<'a, W>
impl<'a, W> !UnwindSafe for SerializedPageWriter<'a, W>
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
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