mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
40 lines
17 KiB
HTML
40 lines
17 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="In memory write buffer."><title>Memtable in mito2::memtable - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mito2" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Memtable</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mito2/index.html">mito2</a><span class="version">1.0.0-beta.4</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Memtable</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.fork" title="fork">fork</a></li><li><a href="#tymethod.freeze" title="freeze">freeze</a></li><li><a href="#tymethod.id" title="id">id</a></li><li><a href="#tymethod.is_empty" title="is_empty">is_empty</a></li><li><a href="#tymethod.ranges" title="ranges">ranges</a></li><li><a href="#tymethod.stats" title="stats">stats</a></li><li><a href="#tymethod.write" title="write">write</a></li><li><a href="#tymethod.write_bulk" title="write_bulk">write_bulk</a></li><li><a href="#tymethod.write_one" title="write_one">write_one</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.compact" title="compact">compact</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In mito2::<wbr>memtable</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mito2</a>::<wbr><a href="index.html">memtable</a></div><h1>Trait <span class="trait">Memtable</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/mito2/memtable.rs.html#244-301">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Memtable:
|
|
<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>
|
|
+ <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>
|
|
+ <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
|
|
// Required methods
|
|
fn <a href="#tymethod.id" class="fn">id</a>(&self) -> <a class="type" href="type.MemtableId.html" title="type mito2::memtable::MemtableId">MemtableId</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.write" class="fn">write</a>(&self, kvs: &<a class="struct" href="struct.KeyValues.html" title="struct mito2::memtable::KeyValues">KeyValues</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.write_one" class="fn">write_one</a>(&self, key_value: KeyValue<'_>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.write_bulk" class="fn">write_bulk</a>(&self, part: <a class="struct" href="bulk/part/struct.BulkPart.html" title="struct mito2::memtable::bulk::part::BulkPart">BulkPart</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.ranges" class="fn">ranges</a>(
|
|
&self,
|
|
projection: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&[ColumnId]>,
|
|
options: <a class="struct" href="struct.RangesOptions.html" title="struct mito2::memtable::RangesOptions">RangesOptions</a>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="struct" href="struct.MemtableRanges.html" title="struct mito2::memtable::MemtableRanges">MemtableRanges</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.freeze" class="fn">freeze</a>(&self) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.stats" class="fn">stats</a>(&self) -> <a class="struct" href="struct.MemtableStats.html" title="struct mito2::memtable::MemtableStats">MemtableStats</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.fork" class="fn">fork</a>(&self, id: <a class="type" href="type.MemtableId.html" title="type mito2::memtable::MemtableId">MemtableId</a>, metadata: &RegionMetadataRef) -> <a class="type" href="type.MemtableRef.html" title="type mito2::memtable::MemtableRef">MemtableRef</a>;
|
|
|
|
// Provided method
|
|
fn <a href="#method.compact" class="fn">compact</a>(&self, for_flush: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>In memory write buffer.</p>
|
|
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.id" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#246">Source</a><h4 class="code-header">fn <a href="#tymethod.id" class="fn">id</a>(&self) -> <a class="type" href="type.MemtableId.html" title="type mito2::memtable::MemtableId">MemtableId</a></h4></section></summary><div class="docblock"><p>Returns the id of this memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.write" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#249">Source</a><h4 class="code-header">fn <a href="#tymethod.write" class="fn">write</a>(&self, kvs: &<a class="struct" href="struct.KeyValues.html" title="struct mito2::memtable::KeyValues">KeyValues</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Writes key values into the memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.write_one" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#252">Source</a><h4 class="code-header">fn <a href="#tymethod.write_one" class="fn">write_one</a>(&self, key_value: KeyValue<'_>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Writes one key value pair into the memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.write_bulk" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#255">Source</a><h4 class="code-header">fn <a href="#tymethod.write_bulk" class="fn">write_bulk</a>(&self, part: <a class="struct" href="bulk/part/struct.BulkPart.html" title="struct mito2::memtable::bulk::part::BulkPart">BulkPart</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Writes an encoded batch of into memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.ranges" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#274-278">Source</a><h4 class="code-header">fn <a href="#tymethod.ranges" class="fn">ranges</a>(
|
|
&self,
|
|
projection: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&[ColumnId]>,
|
|
options: <a class="struct" href="struct.RangesOptions.html" title="struct mito2::memtable::RangesOptions">RangesOptions</a>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="struct" href="struct.MemtableRanges.html" title="struct mito2::memtable::MemtableRanges">MemtableRanges</a>></h4></section></summary><div class="docblock"><p>Returns the ranges in the memtable.</p>
|
|
<p>The returned map contains the range id and the range after applying the predicate.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.is_empty" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#281">Source</a><h4 class="code-header">fn <a href="#tymethod.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns true if the memtable is empty.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.freeze" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#284">Source</a><h4 class="code-header">fn <a href="#tymethod.freeze" class="fn">freeze</a>(&self) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Turns a mutable memtable into an immutable memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.stats" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#287">Source</a><h4 class="code-header">fn <a href="#tymethod.stats" class="fn">stats</a>(&self) -> <a class="struct" href="struct.MemtableStats.html" title="struct mito2::memtable::MemtableStats">MemtableStats</a></h4></section></summary><div class="docblock"><p>Returns the <a href="struct.MemtableStats.html" title="struct mito2::memtable::MemtableStats">MemtableStats</a> info of Memtable.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.fork" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#292">Source</a><h4 class="code-header">fn <a href="#tymethod.fork" class="fn">fork</a>(&self, id: <a class="type" href="type.MemtableId.html" title="type mito2::memtable::MemtableId">MemtableId</a>, metadata: &RegionMetadataRef) -> <a class="type" href="type.MemtableRef.html" title="type mito2::memtable::MemtableRef">MemtableRef</a></h4></section></summary><div class="docblock"><p>Forks this (immutable) memtable and returns a new mutable memtable with specific memtable <code>id</code>.</p>
|
|
<p>A region must freeze the memtable before invoking this method.</p>
|
|
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.compact" class="method"><a class="src rightside" href="../../src/mito2/memtable.rs.html#297-300">Source</a><h4 class="code-header">fn <a href="#method.compact" class="fn">compact</a>(&self, for_flush: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="type" href="../error/type.Result.html" title="type mito2::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Compacts the memtable.</p>
|
|
<p>The <code>for_flush</code> is true when the flush job calls this method.</p>
|
|
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Memtable-for-BulkMemtable" class="impl"><a class="src rightside" href="../../src/mito2/memtable/bulk.rs.html#279-559">Source</a><a href="#impl-Memtable-for-BulkMemtable" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Memtable.html" title="trait mito2::memtable::Memtable">Memtable</a> for <a class="struct" href="bulk/struct.BulkMemtable.html" title="struct mito2::memtable::bulk::BulkMemtable">BulkMemtable</a></h3></section><section id="impl-Memtable-for-PartitionTreeMemtable" class="impl"><a class="src rightside" href="../../src/mito2/memtable/partition_tree.rs.html#133-266">Source</a><a href="#impl-Memtable-for-PartitionTreeMemtable" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Memtable.html" title="trait mito2::memtable::Memtable">Memtable</a> for <a class="struct" href="partition_tree/struct.PartitionTreeMemtable.html" title="struct mito2::memtable::partition_tree::PartitionTreeMemtable">PartitionTreeMemtable</a></h3></section><section id="impl-Memtable-for-SimpleBulkMemtable" class="impl"><a class="src rightside" href="../../src/mito2/memtable/simple_bulk_memtable.rs.html#146-369">Source</a><a href="#impl-Memtable-for-SimpleBulkMemtable" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Memtable.html" title="trait mito2::memtable::Memtable">Memtable</a> for <a class="struct" href="simple_bulk_memtable/struct.SimpleBulkMemtable.html" title="struct mito2::memtable::simple_bulk_memtable::SimpleBulkMemtable">SimpleBulkMemtable</a></h3></section><section id="impl-Memtable-for-TimeSeriesMemtable" class="impl"><a class="src rightside" href="../../src/mito2/memtable/time_series.rs.html#218-389">Source</a><a href="#impl-Memtable-for-TimeSeriesMemtable" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Memtable.html" title="trait mito2::memtable::Memtable">Memtable</a> for <a class="struct" href="time_series/struct.TimeSeriesMemtable.html" title="struct mito2::memtable::time_series::TimeSeriesMemtable">TimeSeriesMemtable</a></h3></section></div><script src="../../trait.impl/mito2/memtable/trait.Memtable.js" async></script></section></div></main></body></html> |