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

llnl / dftracer-utils / 24057299873

07 Apr 2026 12:01AM UTC coverage: 52.076% (+0.8%) from 51.228%
24057299873

push

github

rayandrew
feat(rocksdb): migrate SQLite indexing to RocksDB

Replace SQLite-backed indexing and provenance storage with RocksDB-backed stores.

  Key changes:
  - add RocksDB async/database/db-manager/filesystem/key-codec layers
  - migrate index and provenance databases from SQLite to RocksDB
  - update index builder, trace reader, reorganize, view, stats, and comparator paths for
  RocksDB
  - harden transaction atomicity and rollback behavior with TransactionScope
  - add iterator status checking for prefix scans
  - harden gzip/tar indexer cache state and metadata handling
  - capture executor context in RocksDB awaitables
  - clean up failed RocksDB open paths and manager lifecycle behavior
  - vendor CPM 0.42.1 and update CI/build integration
  - refresh docs, Python bindings, and C++/Python test coverage for the new backend

  Validation:
  - full test suite passed
  - Ubuntu 22.04 Docker run passed
  - focused RocksDB/indexer regression tests passed.

24097 of 59624 branches covered (40.41%)

Branch coverage included in aggregate %.

2516 of 3144 new or added lines in 75 files covered. (80.03%)

72 existing lines in 15 files now uncovered.

20858 of 26701 relevant lines covered (78.12%)

14113.43 hits per line

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

79.49
/src/dftracer/utils/core/rocksdb/key_codec.cpp
1
#include <dftracer/utils/core/rocksdb/key_codec.h>
2

3
#include <stdexcept>
4

5
namespace dftracer::utils::rocksdb {
6

7
namespace {
8

9
template <typename T>
10
T decode_big_endian(std::string_view bytes) {
591,329✔
11
    if (bytes.size() != sizeof(T)) {
591,329!
NEW
12
        throw std::invalid_argument(
×
13
            "KeyCodec: invalid big-endian integer width");
14
    }
15

16
    T value = 0;
591,358✔
17
    for (unsigned char byte : bytes) {
5,080,723✔
18
        value = static_cast<T>((value << 8U) | byte);
4,489,365✔
19
    }
20
    return value;
591,384✔
21
}
22

23
}  // namespace
24

25
std::string KeyCodec::encode_be32(std::uint32_t value) {
16,986✔
26
    std::string out;
16,986✔
27
    out.reserve(sizeof(value));
16,991!
28
    append_be32(out, value);
16,991!
29
    return out;
16,991✔
30
}
8,488!
31

32
std::string KeyCodec::encode_be64(std::uint64_t value) {
2✔
33
    std::string out;
2✔
34
    out.reserve(sizeof(value));
2!
35
    append_be64(out, value);
2!
36
    return out;
2✔
37
}
1!
38

39
std::uint32_t KeyCodec::decode_be32(std::string_view bytes) {
60,339✔
40
    return decode_big_endian<std::uint32_t>(bytes);
60,339✔
41
}
42

43
std::uint64_t KeyCodec::decode_be64(std::string_view bytes) {
531,001✔
44
    return decode_big_endian<std::uint64_t>(bytes);
531,001✔
45
}
46

47
void KeyCodec::append_be32(std::string& out, std::uint32_t value) {
27,306✔
48
    for (int shift = 24; shift >= 0; shift -= 8) {
136,560✔
49
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
109,253✔
50
    }
54,604✔
51
}
27,307✔
52

53
void KeyCodec::append_be64(std::string& out, std::uint64_t value) {
31,541✔
54
    for (int shift = 56; shift >= 0; shift -= 8) {
283,847✔
55
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
252,308✔
56
    }
126,175✔
57
}
31,539✔
58

59
KeyBuilder& KeyBuilder::append_tag(std::string_view tag) {
2✔
60
    key_.append(tag);
2✔
61
    return *this;
2✔
62
}
63

64
KeyBuilder& KeyBuilder::append_separator() {
2✔
65
    key_.push_back('\0');
2✔
66
    return *this;
2✔
67
}
68

NEW
69
KeyBuilder& KeyBuilder::append_string(std::string_view value) {
×
NEW
70
    key_.append(value);
×
NEW
71
    return *this;
×
72
}
73

74
KeyBuilder& KeyBuilder::append_be32(std::uint32_t value) {
2✔
75
    KeyCodec::append_be32(key_, value);
2✔
76
    return *this;
2✔
77
}
78

79
KeyBuilder& KeyBuilder::append_be64(std::uint64_t value) {
2✔
80
    KeyCodec::append_be64(key_, value);
2✔
81
    return *this;
2✔
82
}
83

84
std::string KeyBuilder::build() const { return key_; }
2✔
85

NEW
86
void KeyBuilder::clear() { key_.clear(); }
×
87

88
}  // namespace dftracer::utils::rocksdb
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