quickwit compiles

This commit is contained in:
Ming Ying
2024-12-06 11:26:58 -05:00
committed by Stu Hood
parent 3adc85c017
commit 67ea8e53a8
3 changed files with 15 additions and 10 deletions

View File

@@ -11,11 +11,13 @@ keywords = []
documentation = "https://docs.rs/tantivy-bitpacker/latest/tantivy_bitpacker"
homepage = "https://github.com/quickwit-oss/tantivy"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["pg17"]
pg17 = ["pgrx/pg17"]
[dependencies]
bitpacking = { version = "0.9.2", default-features = false, features = ["bitpacker1x"] }
pgrx = "0.12.7"
[dev-dependencies]
rand = "0.8"

View File

@@ -113,6 +113,16 @@ impl BitUnpacker {
#[inline(never)]
fn get_slow_path(&self, addr: usize, bit_shift: u32, data: &[u8]) -> u64 {
let mut bytes: [u8; 8] = [0u8; 8];
if addr > data.len() {
eprintln!(
"addr: {}, data.len(): {} tid: {}",
addr,
data.len(),
unsafe { pgrx::pg_sys::GetCurrentTransactionId() }
);
}
let available_bytes = data.len() - addr;
// This function is meant to only be called if we did not have 8 bytes to load.
debug_assert!(available_bytes < 8);

View File

@@ -264,7 +264,6 @@ pub(crate) struct InnerSegmentUpdater {
//
// This should be up to date as all update happen through
// the unique active `SegmentUpdater`.
active_index_meta: RwLock<Arc<IndexMeta>>,
pool: ThreadPool,
merge_thread_pool: ThreadPool,
@@ -314,7 +313,6 @@ impl SegmentUpdater {
})?;
let index_meta = index.load_metas()?;
Ok(SegmentUpdater(Arc::new(InnerSegmentUpdater {
active_index_meta: RwLock::new(Arc::new(index_meta)),
pool,
merge_thread_pool,
index,
@@ -420,7 +418,6 @@ impl SegmentUpdater {
};
// TODO add context to the error.
save_metas(&index_meta, directory.box_clone().borrow_mut())?;
self.store_meta(&index_meta);
}
Ok(())
}
@@ -461,12 +458,8 @@ impl SegmentUpdater {
})
}
fn store_meta(&self, index_meta: &IndexMeta) {
*self.active_index_meta.write().unwrap() = Arc::new(index_meta.clone());
}
fn load_meta(&self) -> Arc<IndexMeta> {
self.active_index_meta.read().unwrap().clone()
Arc::new(self.index.load_metas().expect("Failed to load meta"))
}
pub(crate) fn make_merge_operation(&self, segment_ids: &[SegmentId]) -> MergeOperation {