mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-05 08:08:15 -07:00
global: snapshot
This commit is contained in:
@@ -4,7 +4,7 @@ use brk_types::{Indexes, StoredU64, TxVersion};
|
||||
use vecdb::{Exit, ReadableVec, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::internal::ComputedPerBlockCumulativeWithSums;
|
||||
use crate::internal::PerBlockCumulativeWithSums;
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
@@ -13,7 +13,7 @@ impl Vecs {
|
||||
starting_indexes: &Indexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let tx_vany = |tx_vany: &mut ComputedPerBlockCumulativeWithSums<StoredU64, StoredU64>,
|
||||
let tx_vany = |tx_vany: &mut PerBlockCumulativeWithSums<StoredU64, StoredU64>,
|
||||
txversion: TxVersion| {
|
||||
let txversion_vec = &indexer.vecs.transactions.txversion;
|
||||
// Cursor avoids per-transaction PcoVec page decompression.
|
||||
|
||||
@@ -5,7 +5,7 @@ use vecdb::Database;
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{CachedWindowStarts, ComputedPerBlockCumulativeWithSums},
|
||||
internal::{CachedWindowStarts, PerBlockCumulativeWithSums},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -16,9 +16,9 @@ impl Vecs {
|
||||
cached_starts: &CachedWindowStarts,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
v1: ComputedPerBlockCumulativeWithSums::forced_import(db, "tx_v1", version, indexes, cached_starts)?,
|
||||
v2: ComputedPerBlockCumulativeWithSums::forced_import(db, "tx_v2", version, indexes, cached_starts)?,
|
||||
v3: ComputedPerBlockCumulativeWithSums::forced_import(db, "tx_v3", version, indexes, cached_starts)?,
|
||||
v1: PerBlockCumulativeWithSums::forced_import(db, "tx_v1", version, indexes, cached_starts)?,
|
||||
v2: PerBlockCumulativeWithSums::forced_import(db, "tx_v2", version, indexes, cached_starts)?,
|
||||
v3: PerBlockCumulativeWithSums::forced_import(db, "tx_v3", version, indexes, cached_starts)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ use brk_traversable::Traversable;
|
||||
use brk_types::StoredU64;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::ComputedPerBlockCumulativeWithSums;
|
||||
use crate::internal::PerBlockCumulativeWithSums;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub v1: ComputedPerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v2: ComputedPerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v3: ComputedPerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v1: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v2: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub v3: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user