Skip to content

Commit 278edbd

Browse files
committed
Address PR comments
1 parent a44b8c8 commit 278edbd

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

quickwit/quickwit-search/src/list_fields/cache.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,24 @@ impl ListFieldsCache {
3838
self.cache.put(split_id, serialized_split_fields);
3939
}
4040
}
41+
42+
#[cfg(test)]
43+
mod tests {
44+
use bytesize::ByteSize;
45+
46+
use super::*;
47+
48+
#[test]
49+
fn list_fields_cache_get_miss_returns_none() {
50+
let cache = ListFieldsCache::new(&CacheConfig::default_with_capacity(ByteSize::mb(1)));
51+
assert!(cache.get(&"missing".to_string()).is_none());
52+
}
53+
54+
#[test]
55+
fn list_fields_cache_put_then_get_roundtrips() {
56+
let cache = ListFieldsCache::new(&CacheConfig::default_with_capacity(ByteSize::mb(1)));
57+
let payload = OwnedBytes::new(b"hello".to_vec());
58+
cache.put("split-1".to_string(), payload.clone());
59+
assert_eq!(cache.get(&"split-1".to_string()), Some(payload));
60+
}
61+
}

quickwit/quickwit-search/src/list_fields/root.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,5 @@ async fn merge_fields_metadata(
204204
})
205205
})
206206
.await
207-
.context("failed to merge single split list fields")?
207+
.context("failed to merge leaf list fields responses")?
208208
}

0 commit comments

Comments
 (0)