···
pub struct RocksStorage {
pub db: Arc<DBWithThreadMode<MultiThreaded>>, // TODO: mov seqs here (concat merge op will be fun)
did_id_table: IdTable<Did, DidIdValue, true>,
63
-
target_id_table: IdTable<TargetKey, TargetId, false>,
63
+
target_id_table: IdTable<TargetKey, TargetId, true>,
backup_task: Arc<Option<thread::JoinHandle<Result<()>>>>,
···
fn open_readmode(path: impl AsRef<Path>, readonly: bool) -> Result<Self> {
let did_id_table = IdTable::<_, _, true>::setup(DID_IDS_CF);
267
-
let target_id_table = IdTable::<_, _, false>::setup(TARGET_IDS_CF);
267
+
let target_id_table = IdTable::<_, _, true>::setup(TARGET_IDS_CF);
···
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 {
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 {
eprintln!("failed to look up target from target_id {target_id:?}");
968
-
items.push((target, n, dids.len() as u64));
968
+
items.push((target.0.0, *n, dids.len() as u64));
let next = if grouped_counts.len() as u64 >= limit {