pub struct AccountIndexer { /* private fields */ }Expand description
One account’s indexer: its own channel, its own worker, its own tables.
Implementations§
Source§impl AccountIndexer
impl AccountIndexer
Sourcepub fn start(
account: &str,
archive: Arc<File>,
journal: Option<PathBuf>,
) -> Self
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.
Sourcepub fn start_with_absorber(
account: &str,
archive: Arc<File>,
journal: Option<PathBuf>,
absorber: Option<Arc<dyn ObjectAbsorb>>,
) -> Self
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.
Sourcepub fn submit(&self, job: IndexJob) -> Result<()>
pub fn submit(&self, job: IndexJob) -> Result<()>
Hand an extent over. Returns immediately: 24 bytes onto a channel.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Tell the worker to stop: every job still queued is dropped unabsorbed (its pack keeps a clear bit — nothing is declared indexed), and the absorber’s own cancel flag is what aborts the pack in flight.
pub fn is_cancelled(&self) -> bool
Sourcepub fn wait_caught_up(&self)
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.
Sourcepub fn is_indexed(&self, pack_id: u64) -> bool
pub fn is_indexed(&self, pack_id: u64) -> bool
Is this pack’s indexed bit set?
Sourcepub fn absorb_failures(&self) -> u64
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.
Sourcepub fn last_absorb_error(&self) -> Option<String>
pub fn last_absorb_error(&self) -> Option<String>
The most recent absorb error, if any.
Sourcepub fn tables(&self) -> Vec<RecordBatch>
pub fn tables(&self) -> Vec<RecordBatch>
The built index tables.
Sourcepub fn lookup(&self, pack_id: u64) -> Lookup
pub fn lookup(&self, pack_id: u64) -> Lookup
Answer a read, honestly, whether or not the index is ready.
Sourcepub fn finish(self) -> Vec<RecordBatch>
pub fn finish(self) -> Vec<RecordBatch>
Close the channel and join the worker, returning the final tables.
Trait Implementations§
Source§impl Drop for AccountIndexer
impl Drop for AccountIndexer
Source§fn drop(&mut self)
fn drop(&mut self)
Cancel, then join — never join a worker that may be hours into a
pack or parked by the memory watchdog. The queued jobs are dropped
unabsorbed and the pack in flight is aborted at its next checkpoint;
their bits stay clear, so the next open re-queues them from the
journal (resumed 0%). Nobody waits on the indexer, and that includes
the process shutting down and a repo delete.