Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/24376/head
parent
70a82cc038
commit
1cf3ab3978
|
@ -33,3 +33,8 @@ tracker = { path = "../tracker" }
|
|||
[dev-dependencies] # In alphabetical order
|
||||
test_helpers = { path = "../test_helpers" }
|
||||
criterion = "0.3"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
# Disables snapshot caching
|
||||
nocache = []
|
||||
|
|
|
@ -140,6 +140,7 @@ impl Chunk {
|
|||
}
|
||||
|
||||
/// Returns a queryable snapshot of this chunk
|
||||
#[cfg(not(feature = "nocache"))]
|
||||
pub fn snapshot(&self) -> Arc<ChunkSnapshot> {
|
||||
let mut guard = self.snapshot.lock();
|
||||
if let Some(snapshot) = &*guard {
|
||||
|
@ -152,6 +153,12 @@ impl Chunk {
|
|||
snapshot
|
||||
}
|
||||
|
||||
/// Returns a queryable snapshot of this chunk
|
||||
#[cfg(feature = "nocache")]
|
||||
pub fn snapshot(&self) -> Arc<ChunkSnapshot> {
|
||||
Arc::new(ChunkSnapshot::new(self))
|
||||
}
|
||||
|
||||
/// returns true if there is no data in this chunk
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.tables.is_empty()
|
||||
|
|
|
@ -42,6 +42,11 @@ flate2 = "1.0.20"
|
|||
tempfile = "3.1.0"
|
||||
test_helpers = { path = "../test_helpers" }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
# Enable features for benchmarking
|
||||
bench = ["mutable_buffer/nocache"]
|
||||
|
||||
[[bench]]
|
||||
name = "influxrpc"
|
||||
harness = false
|
||||
|
|
Loading…
Reference in New Issue