Files
obikmer/tools/migrate-mphf/src/old.rs
T
Eric Coissac 8b87078478 Implement MPHF migration tool and sparse matrix permutation logic
Refactors sparse matrix handling to implement row permutation logic and introduces a standalone tool for migrating indexes from MPHF 1.x to 2.x formats.
2026-10-15 12:12:51 +02:00

18 lines
664 B
Rust

//! The previous MPHF generation (`ptr_hash` 1.x), kept only to read the
//! `mphf.bin` files of indexes built before the migration.
use std::path::Path;
use anyhow::{Result, anyhow};
use cacheline_ef_old::{CachelineEf, CachelineEfVec};
use epserde_old::prelude::*;
use ptr_hash_old::{PtrHash, bucket_fn::CubicEps, hash::Xx64};
/// Exactly the type `obikindex` used before the migration.
pub type OldMphf = PtrHash<u64, CubicEps, CachelineEfVec<Vec<CachelineEf>>, Xx64, Vec<u8>>;
pub fn load(path: &Path) -> Result<OldMphf> {
OldMphf::load_full(path)
.map_err(|e| anyhow!("{}: not a ptr_hash 1.x MPHF (already converted?): {e}", path.display()))
}