mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-30 15:10:40 +00:00
quickwit compiles
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user