Skip to content

Commit

Permalink
add compatibility logic during convert table opts pb to table opts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed May 27, 2024
1 parent a9c4041 commit 8057329
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/analytic_engine/src/memtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,24 @@ impl Default for LayeredMemtableOptions {

impl From<manifest::LayeredMemtableOptions> for LayeredMemtableOptions {
fn from(value: manifest::LayeredMemtableOptions) -> Self {
let mutable_segment_switch_threshold = ReadableSize(value.mutable_segment_switch_threshold);

let enable = match value.enable {
Some(Enable::EnableOpt(enable)) => enable,
None => false,
None => {
// For compatibility, mutable_segment_switch_threshold is used to decision
// whether use the layered memtable in former.
// So this situation is possible to exist:
//
// mutable_segment_switch_threshold > 0 and enable none
//
// And in this situation, layered memtable should be used.
if mutable_segment_switch_threshold.0 > 0 {
true
} else {
false
}
}
};

Self {
Expand Down

0 comments on commit 8057329

Please sign in to comment.