use std::path::PathBuf;
use std::sync::Arc;
use crate::{analysis::data_quality, analysis::sampling};
pub(crate) struct QualityCacheEntry {
pub(crate) dataset_generation: u64,
pub(crate) view_generation: u64,
pub(crate) plan: data_quality::DataQualityPlan,
pub(crate) results: data_quality::DataQualityResults,
pub(crate) bytes: usize,
}
#[derive(Debug, Clone)]
pub struct KeptQualitySample {
pub(crate) dataset_generation: u64,
pub(crate) view_generation: u64,
pub(crate) sample: sampling::Sample,
pub(crate) rows: std::sync::Arc<data_quality::QualitySample>,
pub(crate) source: crate::analysis::quality_export::SourceIdentity,
}
impl KeptQualitySample {
pub(crate) fn same_rows(&self, other: &Self) -> bool {
self.dataset_generation == other.dataset_generation
&& self.view_generation == other.view_generation
&& self.sample == other.sample
}
}
pub const QUALITY_MEMORY_BUDGET: usize = 256 * 1024 * 1024;
pub(crate) enum QualityCopyJob {
Source,
Kept(Arc<crate::cloud::local_copy::LocalCopy>),
Fetch {
objects: Vec<crate::cloud::local_copy::RemoteObject>,
root: PathBuf,
},
}
#[derive(Debug, Clone)]
pub struct RetainedCopy {
pub(crate) dataset_generation: u64,
pub(crate) copy: Arc<crate::cloud::local_copy::LocalCopy>,
}
pub(crate) const QUALITY_RELEASED_REMEMBERED: usize = 16;