Skip to main content

AccountIndexer

Struct AccountIndexer 

Source
pub struct AccountIndexer { /* private fields */ }
Expand description

One account’s indexer: its own channel, its own worker, its own tables.

Implementations§

Source§

impl AccountIndexer

Source

pub fn start( account: &str, archive: Arc<File>, journal: Option<PathBuf>, ) -> Self

Start an indexer for account reading extents back out of archive. journal is the ack-path durable record a not-yet-indexed read falls back to scanning; None for a writer that keeps none.

Pack rows only. For the object rows as well, see start_with_absorber — a writer bench has no git store behind it and wants exactly this.

Source

pub fn start_with_absorber( account: &str, archive: Arc<File>, journal: Option<PathBuf>, absorber: Option<Arc<dyn ObjectAbsorb>>, ) -> Self

The same indexer with the object-level half wired in: each drained job’s objects are absorbed through absorber before the pack’s indexed bit goes up.

Source

pub fn account(&self) -> &str

The account this indexer belongs to.

Source

pub fn submit(&self, job: IndexJob) -> Result<()>

Hand an extent over. Returns immediately: 24 bytes onto a channel.

Source

pub fn wait_caught_up(&self)

Block until this account’s index has caught up with everything submitted so far. Used by tests and by the bench’s “with index” column.

Source

pub fn is_indexed(&self, pack_id: u64) -> bool

Is this pack’s indexed bit set?

Source

pub fn rows(&self) -> usize

Number of index rows built so far.

Source

pub fn absorb_failures(&self) -> u64

How many packs failed ObjectAbsorb::absorb in this indexer. Their indexed bits are clear and their reads still fall back.

Source

pub fn last_absorb_error(&self) -> Option<String>

The most recent absorb error, if any.

Source

pub fn tables(&self) -> Vec<RecordBatch>

The built index tables.

Source

pub fn lookup(&self, pack_id: u64) -> Lookup

Answer a read, honestly, whether or not the index is ready.

Source

pub fn finish(self) -> Vec<RecordBatch>

Close the channel and join the worker, returning the final tables.

Trait Implementations§

Source§

impl Drop for AccountIndexer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.