Skip to main content

Module object_storage_tiering

Module object_storage_tiering 

Source
Expand description

ObjectStorageTiering — hierarchical object storage tiering (hot/warm/cold).

Provides a production-quality tiered object storage system that automatically migrates objects between Hot, Warm, and Cold storage tiers based on configurable policies (access frequency, recency, size thresholds, cost optimization).

§Type Aliases

Due to name collisions with existing crate types, all public types use the Ost prefix:

  • OstStorageTier — Hot/Warm/Cold tier enum
  • OstTierPolicy — tiering policy variants
  • OstTierConfig — tier capacity and policy configuration
  • OstTierTransition — record of an object moving between tiers

§Example

use ipfrs_storage::object_storage_tiering::{
    ObjectStorageTiering, OstStorageTier, OstTierConfig, OstTierPolicy, TieredObject,
};

let config = OstTierConfig {
    hot_capacity_bytes: 1_024 * 1_024,
    warm_capacity_bytes: 10 * 1_024 * 1_024,
    cold_capacity_bytes: u64::MAX,
    policy: OstTierPolicy::AccessFrequency(5),
    promotion_threshold: 3,
    demotion_interval_us: 60_000_000,
};

let mut tiering = ObjectStorageTiering::new(config);

let obj = TieredObject {
    id: "obj-1".to_string(),
    size_bytes: 512,
    current_tier: OstStorageTier::Hot,
    access_count: 0,
    last_accessed: 0,
    created_at: 0,
    tags: vec![],
    cost_per_hour: 0.001,
};

let tier = tiering.store(obj).unwrap();
assert_eq!(tier, OstStorageTier::Hot);

Structs§

ObjectStorageTiering
Production-quality hierarchical object storage tiering engine.
OstTierConfig
Capacity and policy configuration for the tiering engine.
OstTierTransition
Record of an object moving between storage tiers.
TieredObject
An object managed by the tiering engine.
TieringStats
Aggregate statistics for the tiering engine.

Enums§

OstStorageTier
Three-level object storage tier hierarchy.
OstTierPolicy
Policy that drives automatic tier promotions and demotions.
TieringError
Errors returned by the tiering engine.