···
16
16
// use rocksdb::IteratorMode;
17
17
// use std::time;
18
18
19
19
-
// /// Aggregate links in the at-mosphere
19
19
+
// xxxx/// Aggregate links in the at-mosphere
20
20
// #[derive(Parser, Debug)]
21
21
// #[command(version, about, long_about = None)]
22
22
// struct Args {
···
54
54
// 262_144, 1_048_576,
55
55
// ];
56
56
57
57
-
// // b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b12, b16, b32, b64, b128, b256, b512, b1024, b4096, b16384, b65535, b262144, bmax
57
57
+
// xxx// b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b12, b16, b32, b64, b128, b256, b512, b1024, b4096, b16384, b65535, b262144, bmax
58
58
59
59
// static DID_IDS_CF: &str = "did_ids";
60
60
// static TARGET_IDS_CF: &str = "target_ids";
···
270
270
// eprintln!("bye.");
271
271
// }
272
272
273
273
-
// // scan plan
273
273
+
// xxx// scan plan
274
274
275
275
-
// // buckets (backlink count)
276
276
-
// // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 32, 64, 128, 256, 512, 1024, 4096, 16384, 65535, 262144, 1048576+
277
277
-
// // by
278
278
-
// // - collection
279
279
-
// // - json path
280
280
-
// // - link type
281
281
-
// // samples for each bucket for each variation
275
275
+
// xxx// buckets (backlink count)
276
276
+
// xxx// 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 32, 64, 128, 256, 512, 1024, 4096, 16384, 65535, 262144, 1048576+
277
277
+
// xxx// by
278
278
+
// xxx// - collection
279
279
+
// xxx// - json path
280
280
+
// xxx// - link type
281
281
+
// xxx// samples for each bucket for each variation
282
282
+
fn main() {}
···
186
186
187
187
let did_rkeys: Vec<_> = if let Some(dids) = filter_dids {
188
188
did_rkeys
189
189
-
.into_iter()
190
190
-
.cloned()
189
189
+
.iter()
191
190
.filter(|m| {
192
192
-
m.clone()
191
191
+
Option::<(Did, RKey)>::clone(m)
193
192
.map(|(did, _)| dids.contains(&did))
194
193
.unwrap_or(false)
195
194
})
195
195
+
.cloned()
196
196
.collect()
197
197
} else {
198
198
did_rkeys.to_vec()
···
782
782
storage.push(
783
783
&ActionableEvent::CreateLinks {
784
784
record_id: RecordId {
785
785
-
did: format!("did:plc:linker").into(),
785
785
+
did: "did:plc:linker".into(),
786
786
collection: "app.t.c".into(),
787
787
rkey: "asdf".into(),
788
788
},
···
835
835
storage.push(
836
836
&ActionableEvent::CreateLinks {
837
837
record_id: RecordId {
838
838
-
did: format!("did:plc:linker").into(),
838
838
+
did: "did:plc:linker".into(),
839
839
collection: "app.t.c".into(),
840
840
rkey: "asdf-2".into(),
841
841
},
···
849
849
storage.push(
850
850
&ActionableEvent::CreateLinks {
851
851
record_id: RecordId {
852
852
-
did: format!("did:plc:someone-else").into(),
852
852
+
did: "did:plc:someone-else".into(),
853
853
collection: "app.t.c".into(),
854
854
rkey: "asdf".into(),
855
855
},
···
876
876
});
877
877
};
878
878
879
879
-
let linkers = self.get_target_linkers(&target_id)?;
879
879
+
let mut linkers = self.get_target_linkers(&target_id)?;
880
880
+
if let Some(dids) = filter_dids {
881
881
+
let mut did_filter = HashSet::new();
882
882
+
for did in dids {
883
883
+
let Some(DidIdValue(did_id, active)) =
884
884
+
self.did_id_table.get_id_val(&self.db, did)?
885
885
+
else {
886
886
+
eprintln!("failed to find a did_id for {did:?}");
887
887
+
continue;
888
888
+
};
889
889
+
if !active {
890
890
+
eprintln!("excluding inactive did from filtered results");
891
891
+
continue;
892
892
+
}
893
893
+
did_filter.insert(did_id);
894
894
+
}
895
895
+
linkers.0.retain(|linker| did_filter.contains(&linker.0));
896
896
+
}
880
897
881
898
let (alive, gone) = linkers.count();
882
899
let total = alive + gone;