/// Initialize a new lifecycle manager that will persist when `maybe_persist` is called
/// if anything is over the size or age threshold.
Initialize a new lifecycle manager that will persist when `maybe_persist` is called
if anything is over the size or age threshold.
Initialize a new lifecycle manager that will persist when ` maybe_persist ` is called if anything is over the size or age threshold .
pub(crate) fn new(
        config: LifecycleConfig,
        metric_registry: Arc<metric::Registry>,
        time_provider: Arc<dyn TimeProvider>,
    ) -> Self {
        let persist_counter: Metric<U64Counter> = metric_registry.register_metric(
            "ingester_lifecycle_persist_count",
            "counter for different triggers that cause partition persistence",
        );
        let persist_memory_counter = persist_counter.recorder(&[("trigger", "memory")]);
        let persist_size_counter = persist_counter.recorder(&[("trigger", "size")]);
        let persist_age_counter = persist_counter.recorder(&[("trigger", "age")]);
        let persist_cold_counter = persist_counter.recorder(&[("trigger", "cold")]);
        let job_registry = Arc::new(JobRegistry::new(
            metric_registry,
            Arc::clone(&time_provider),
        ));
        Self {
            config: Arc::new(config),
            time_provider,
            job_registry,
            state: Default::default(),
            persist_memory_counter,
            persist_size_counter,
            persist_age_counter,
            persist_cold_counter,
        }
    }
pub ( crate ) fn new ( config : LifecycleConfig , metric_registry : Arc < metric :: Registry > , time_provider : Arc < dyn TimeProvider > , ) -> Self { let persist_counter : Metric < U64Counter > = metric_registry . register_metric ( " " , " " , ) ; let persist_memory_counter = persist_counter . recorder ( & [ ( " " , " " ) ] ) ; let persist_size_counter = persist_counter . recorder ( & [ ( " " , " " ) ] ) ; let persist_age_counter = persist_counter . recorder ( & [ ( " " , " " ) ] ) ; let persist_cold_counter = persist_counter . recorder ( & [ ( " " , " " ) ] ) ; let job_registry = Arc :: new ( JobRegistry :: new ( metric_registry , Arc :: clone ( & time_provider ) , ) ) ; Self { config : Arc :: new ( config ) , time_provider , job_registry , state : Default :: default ( ) , persist_memory_counter , persist_size_counter , persist_age_counter , persist_cold_counter , } }
Initialize a new lifecycle manager that will persist when `maybe_persist` is called
if anything is over the size or age threshold.
Initialize a new lifecycle manager that will persist when ` maybe_persist ` is called if anything is over the size or age threshold .
config
LifecycleConfig
metric_registry
Arc<metric::Registry>
time_provider
Arc<dyn TimeProvider>