mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
global: MASSIVE snapshot
This commit is contained in:
@@ -13,12 +13,12 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.indexes_to_count.compute_rest(
|
||||
self.indexes_to_count.derive_from(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&indexes.transaction.txindex_to_input_count,
|
||||
exit,
|
||||
Some(&indexes.transaction.txindex_to_input_count),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -1,33 +1,15 @@
|
||||
use brk_error::Result;
|
||||
use brk_types::Version;
|
||||
use vecdb::{Database, IterableCloneableVec};
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedVecsFromTxindex, Source, VecBuilderOptions},
|
||||
};
|
||||
use crate::{indexes, internal::DerivedTxFull};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(db: &Database, version: Version, indexes: &indexes::Vecs) -> Result<Self> {
|
||||
let full_stats = || {
|
||||
VecBuilderOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
.add_percentiles()
|
||||
.add_sum()
|
||||
.add_cumulative()
|
||||
};
|
||||
let indexes_to_count =
|
||||
DerivedTxFull::forced_import(db, "input_count", version, indexes)?;
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_count: ComputedVecsFromTxindex::forced_import(
|
||||
db,
|
||||
"input_count",
|
||||
Source::Vec(indexes.transaction.txindex_to_input_count.boxed_clone()),
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?,
|
||||
})
|
||||
Ok(Self { indexes_to_count })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::StoredU64;
|
||||
|
||||
use crate::internal::ComputedVecsFromTxindex;
|
||||
use crate::internal::DerivedTxFull;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_count: ComputedVecsFromTxindex<StoredU64>,
|
||||
pub indexes_to_count: DerivedTxFull<StoredU64>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user