From bde4a7e5e2b580cc5a36fb73e9f007ff52b1823f Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sat, 4 Jun 2022 23:14:57 +0100 Subject: [PATCH] Allow inspecting more domains --- quickpeep_raker/src/bin/qp-raker-db.rs | 69 +++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/quickpeep_raker/src/bin/qp-raker-db.rs b/quickpeep_raker/src/bin/qp-raker-db.rs index a3b2904..f6f49b8 100644 --- a/quickpeep_raker/src/bin/qp-raker-db.rs +++ b/quickpeep_raker/src/bin/qp-raker-db.rs @@ -15,7 +15,10 @@ use std::path::PathBuf; use quickpeep_raker::config; use quickpeep_raker::storage::mdbx_helper_types::MdbxBare; -use quickpeep_raker::storage::records::AllowedDomainRecord; +use quickpeep_raker::storage::records::{ + ActiveDomainRecord, AllowedDomainRecord, BackingOffDomainRecord, OnHoldUrlRecord, + QueueUrlRecord, UrlVisitedRecord, WeedDomainRecord, +}; use quickpeep_raker::storage::{RakerStore, RakerTxn}; /// Seeds a raker's queue with URLs @@ -60,6 +63,54 @@ pub async fn main() -> anyhow::Result<()> { let txn = store.ro_txn()?; match opts.table.as_ref() { + "queue_urls" | "urls_queue" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().queue_urls, + &txn, + )?; + } + "active_domains" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().active_domains, + &txn, + )?; + } + "active_domains_raffle" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().active_domain_raffle, + &txn, + )?; + } + "backing_off_reinstatements" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().backing_off_reinstatements, + &txn, + )?; + } + "backing_off_domains" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().backing_off_domains, + &txn, + )?; + } + "visited_urls" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().visited_urls, + &txn, + )?; + } "allowed_domains" => { inspect::>( opts.key_name.as_ref(), @@ -68,6 +119,22 @@ pub async fn main() -> anyhow::Result<()> { &txn, )?; } + "urls_on_hold" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().urls_on_hold, + &txn, + )?; + } + "weed_domains" => { + inspect::>( + opts.key_name.as_ref(), + opts.prefix, + &txn.mdbx.borrow_dbs().weed_domains, + &txn, + )?; + } other => { dark_yellow_ln!("Unknown database {:?}", other); }