MCPcopy Create free account
hub / github.com/apache/paimon-rust / flush

Method flush

crates/paimon/src/btree/sst_file.rs:102–114  ·  view source on GitHub ↗

Flush the current data block to output.

(&mut self)

Source from the content-addressed store, hash-verified

100
101 /// Flush the current data block to output.
102 pub async fn flush(&mut self) -> io::Result<()> {
103 if self.data_block_writer.entry_count() == 0 {
104 return Ok(());
105 }
106
107 let block_handle = self.write_block_data().await?;
108 let (handle_buf, handle_len) = block_handle.encode_to_buf();
109 if let Some(ref last_key) = self.last_key {
110 self.index_block_writer
111 .add(last_key, &handle_buf[..handle_len]);
112 }
113 Ok(())
114 }
115
116 /// Write a data block: compress, compute CRC, write block + trailer.
117 async fn write_block_data(&mut self) -> io::Result<BlockHandle> {

Callers 3

putMethod · 0.45
test_sst_file_roundtripFunction · 0.45
finishMethod · 0.45

Calls 4

entry_countMethod · 0.80
write_block_dataMethod · 0.80
encode_to_bufMethod · 0.80
addMethod · 0.45

Tested by 1

test_sst_file_roundtripFunction · 0.36