Files
obikmer/tools/migrate-mphf/src/old.rs
T

17 lines
664 B
Rust
Raw Normal View History

//! 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()))
}