+5
-5
constellation/src/storage/rocks_store.rs
+5
-5
constellation/src/storage/rocks_store.rs
···
60
pub struct RocksStorage {
61
pub db: Arc<DBWithThreadMode<MultiThreaded>>, // TODO: mov seqs here (concat merge op will be fun)
62
did_id_table: IdTable<Did, DidIdValue, true>,
63
-
target_id_table: IdTable<TargetKey, TargetId, false>,
64
is_writer: bool,
65
backup_task: Arc<Option<thread::JoinHandle<Result<()>>>>,
66
}
···
264
265
fn open_readmode(path: impl AsRef<Path>, readonly: bool) -> Result<Self> {
266
let did_id_table = IdTable::<_, _, true>::setup(DID_IDS_CF);
267
-
let target_id_table = IdTable::<_, _, false>::setup(TARGET_IDS_CF);
268
269
let cfs = vec![
270
// id reference tables
···
960
}
961
962
let mut items: Vec<(String, u64, u64)> = Vec::with_capacity(grouped_counts.len());
963
-
for (target_id, (n, dids)) in grouped_counts {
964
-
let Some(target) = self.target_id_table.get_val_from_id(&self.db, target_id)? else {
965
eprintln!("failed to look up target from target_id {target_id:?}");
966
continue;
967
};
968
-
items.push((target, n, dids.len() as u64));
969
}
970
971
let next = if grouped_counts.len() as u64 >= limit {
···
60
pub struct RocksStorage {
61
pub db: Arc<DBWithThreadMode<MultiThreaded>>, // TODO: mov seqs here (concat merge op will be fun)
62
did_id_table: IdTable<Did, DidIdValue, true>,
63
+
target_id_table: IdTable<TargetKey, TargetId, true>,
64
is_writer: bool,
65
backup_task: Arc<Option<thread::JoinHandle<Result<()>>>>,
66
}
···
264
265
fn open_readmode(path: impl AsRef<Path>, readonly: bool) -> Result<Self> {
266
let did_id_table = IdTable::<_, _, true>::setup(DID_IDS_CF);
267
+
let target_id_table = IdTable::<_, _, true>::setup(TARGET_IDS_CF);
268
269
let cfs = vec![
270
// id reference tables
···
960
}
961
962
let mut items: Vec<(String, u64, u64)> = Vec::with_capacity(grouped_counts.len());
963
+
for (target_id, (n, dids)) in &grouped_counts {
964
+
let Some(target) = self.target_id_table.get_val_from_id(&self.db, target_id.0)? else {
965
eprintln!("failed to look up target from target_id {target_id:?}");
966
continue;
967
};
968
+
items.push((target.0.0, *n, dids.len() as u64));
969
}
970
971
let next = if grouped_counts.len() as u64 >= limit {