• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 4392484403

pending completion
4392484403

push

github

GitHub
feat: Asynchoronous indexing (#1206)

270 of 270 new or added lines in 13 files covered. (100.0%)

28714 of 38777 relevant lines covered (74.05%)

89484.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/dozer-cache/src/cache/lmdb/tests/utils.rs
1
use dozer_types::types::{Field, IndexDefinition, Record, Schema, SchemaWithIndex};
2

3
use crate::cache::{
4
    lmdb::{
5
        cache::{LmdbCache, LmdbRwCache, SecondaryEnvironment},
6
        indexing::IndexingThreadPool,
7
    },
8
    RoCache, RwCache,
×
9
};
×
10

×
11
pub fn create_cache(
11✔
12
    schema_gen: impl FnOnce() -> SchemaWithIndex,
11✔
13
) -> (
11✔
14
    LmdbRwCache,
11✔
15
    IndexingThreadPool,
11✔
16
    Schema,
11✔
17
    Vec<IndexDefinition>,
11✔
18
) {
11✔
19
    let schema = schema_gen();
11✔
20
    let mut indexing_thread_pool = IndexingThreadPool::new(1);
11✔
21
    let cache = LmdbRwCache::new(
11✔
22
        Some(&schema),
11✔
23
        &Default::default(),
11✔
24
        Default::default(),
11✔
25
        &mut indexing_thread_pool,
11✔
26
    )
11✔
27
    .unwrap();
11✔
28
    (cache, indexing_thread_pool, schema.0, schema.1)
11✔
29
}
11✔
30

×
31
pub fn insert_rec_1(
16✔
32
    cache: &LmdbRwCache,
16✔
33
    schema: &Schema,
16✔
34
    (a, b, c): (i64, Option<String>, Option<i64>),
16✔
35
) {
16✔
36
    let mut record = Record::new(
16✔
37
        schema.identifier,
16✔
38
        vec![
16✔
39
            Field::Int(a),
16✔
40
            b.map_or(Field::Null, Field::String),
16✔
41
            c.map_or(Field::Null, Field::Int),
16✔
42
        ],
16✔
43
        None,
16✔
44
    );
16✔
45
    cache.insert(&mut record).unwrap();
16✔
46
}
16✔
47

×
48
pub fn insert_full_text(
1✔
49
    cache: &LmdbRwCache,
1✔
50
    schema: &Schema,
1✔
51
    (a, b): (Option<String>, Option<String>),
1✔
52
) {
1✔
53
    let mut record = Record::new(
1✔
54
        schema.identifier,
1✔
55
        vec![
1✔
56
            a.map_or(Field::Null, Field::String),
1✔
57
            b.map_or(Field::Null, Field::Text),
1✔
58
        ],
1✔
59
        None,
1✔
60
    );
1✔
61
    cache.insert(&mut record).unwrap();
1✔
62
}
1✔
63

64
pub fn get_index_counts<C: LmdbCache>(cache: &C) -> Vec<usize> {
3✔
65
    (0..cache.get_schema().1.len())
3✔
66
        .map(|index| cache.secondary_env(index).count_data().unwrap())
10✔
67
        .collect()
3✔
68
}
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc