45 lines
1.7 KiB
Rust
45 lines
1.7 KiB
Rust
use rocksdb::{ColumnFamilyDescriptor, DBCompressionType, Options};
|
|
|
|
pub const CF_VALIDATED_PUBLICATION_POINT: &str = "validated_publication_point";
|
|
pub const CF_REPOSITORY_VIEW: &str = "repository_view";
|
|
pub const CF_RAW_BY_HASH: &str = "raw_by_hash";
|
|
pub const CF_RAW_BLOB: &str = "raw_blob";
|
|
/// Persistent RFC 9286 manifest freshness metadata. This is protocol state,
|
|
/// not a validation-result cache.
|
|
pub const CF_MANIFEST_ANTI_ROLLBACK: &str = "manifest_anti_rollback";
|
|
pub const CF_RRDP_SOURCE: &str = "rrdp_source";
|
|
pub const CF_RRDP_SOURCE_MEMBER: &str = "rrdp_source_member";
|
|
pub const CF_RRDP_URI_OWNER: &str = "rrdp_uri_owner";
|
|
|
|
pub const ALL_COLUMN_FAMILY_NAMES: &[&str] = &[
|
|
CF_REPOSITORY_VIEW,
|
|
CF_VALIDATED_PUBLICATION_POINT,
|
|
CF_RAW_BY_HASH,
|
|
CF_RAW_BLOB,
|
|
CF_MANIFEST_ANTI_ROLLBACK,
|
|
CF_RRDP_SOURCE,
|
|
CF_RRDP_SOURCE_MEMBER,
|
|
CF_RRDP_URI_OWNER,
|
|
];
|
|
|
|
pub(super) const REPOSITORY_VIEW_KEY_PREFIX: &str = "repo_view:";
|
|
pub(super) const RAW_BY_HASH_KEY_PREFIX: &str = "rawbyhash:";
|
|
pub(super) const RAW_BLOB_KEY_PREFIX: &str = "rawblob:";
|
|
pub(super) const RRDP_SOURCE_KEY_PREFIX: &str = "rrdp_source:";
|
|
pub(super) const RRDP_SOURCE_MEMBER_KEY_PREFIX: &str = "rrdp_source_member:";
|
|
pub(super) const RRDP_URI_OWNER_KEY_PREFIX: &str = "rrdp_uri_owner:";
|
|
|
|
pub(super) fn configure_work_db_options(opts: &mut Options) {
|
|
opts.set_compression_type(DBCompressionType::Lz4);
|
|
}
|
|
pub fn column_family_descriptors() -> Vec<ColumnFamilyDescriptor> {
|
|
ALL_COLUMN_FAMILY_NAMES
|
|
.iter()
|
|
.map(|name| {
|
|
let mut opts = Options::default();
|
|
configure_work_db_options(&mut opts);
|
|
ColumnFamilyDescriptor::new(*name, opts)
|
|
})
|
|
.collect()
|
|
}
|