Expand description
Structured wrapper crate on top of cobble.
This crate mirrors Cobble’s main usage flows, but with typed structured
columns (Bytes / List) and typed decode/encode wrappers.
§1) Single-machine embedded (StructuredSingleDb)
ⓘ
use cobble::{Config, VolumeDescriptor};
use cobble_data_structure::{ListConfig, ListRetainMode, StructuredSingleDb};
let mut config = Config::default();
config.num_columns = 2;
config.total_buckets = 1;
config.volumes = VolumeDescriptor::single_volume("file:///tmp/cobble-ssingle".to_string());
let mut db = StructuredSingleDb::open(config)?;
db.update_schema().add_list_column(
1,
ListConfig {
max_elements: Some(100),
retain_mode: ListRetainMode::Last,
preserve_element_ttl: false,
},
).commit()?;
db.put(0, b"k1", 0, b"v1".to_vec())?;
let snapshot_id = db.snapshot()?;
let snapshots = db.list_snapshots()?;§2) Distributed write path wrappers
Use StructuredDb on shard writers and keep coordinator/global snapshot flow
identical to cobble::Db + cobble::DbCoordinator.
§3) Snapshot-following reading wrappers (StructuredReader)
StructuredReader follows global snapshots like cobble::Reader, but returns
typed structured rows.
§4) Distributed scan wrappers
Use StructuredScanPlan / StructuredScanSplit / StructuredScanSplitScanner
for snapshot-based distributed scan with structured row decoding.
§5) Fixed snapshot read wrappers
Use StructuredReadOnlyDb for pinned-snapshot reads with structured decoding.
Structs§
- List
Config - Structured
Db - Structured
DbIterator - Structured
Read Only Db - Structured
Reader - Structured
Remote Compaction Server - A remote compaction server pre-configured to resolve structured data type merge operators (e.g. list) from request metadata.
- Structured
Scan Plan - Structured distributed scan plan.
- Structured
Scan Split - Structured version of a distributed scan split.
- Structured
Scan Split Scanner - Structured
Schema - Structured
Schema Builder - Structured
Single Db - Structured
Write Batch - Structured write batch wrapper.
Enums§
Functions§
- structured_
merge_ operator_ resolver - Returns a
MergeOperatorResolverthat can resolve all structured data type merge operators (e.g. list) from their metadata. - structured_
resolvable_ operator_ ids - Returns the merge operator IDs that
structured_merge_operator_resolvercan resolve.
Type Aliases§
- Data
Structure Db - Type alias for backward compatibility.