use datafusion_execution::cache::cache_manager::FileMetadata;
use vortex::file::Footer;
use vortex::file::VortexFile;
pub struct CachedVortexMetadata {
footer: Footer,
}
impl CachedVortexMetadata {
pub fn new(vortex_file: &VortexFile) -> Self {
let footer = vortex_file.footer();
Self {
footer: footer.clone(),
}
}
pub fn footer(&self) -> &Footer {
&self.footer
}
}
impl FileMetadata for CachedVortexMetadata {
fn as_any(&self) -> &dyn std::any::Any {
self
}
fn memory_size(&self) -> usize {
self.footer
.approx_byte_size()
.unwrap_or(1024 * 64)
}
#[expect(clippy::disallowed_types)]
fn extra_info(&self) -> std::collections::HashMap<String, String> {
Default::default()
}
}