Skip to main content

PushPath

Struct PushPath 

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

A git server’s push path: one ArchiveWrite arm plus the shared indexer.

This is what the bench drives, and the reason the indexer is shared rather than per-impl: swapping the writer changes the durability contract and nothing else.

Implementations§

Source§

impl PushPath

Source

pub fn new( writer: Box<dyn ArchiveWrite>, archive: &Path, journal: Option<PathBuf>, ) -> Result<Self>

Wrap a writer. archive must be the file the writer appends to; journal the ack-path record a pre-index read falls back to, if the writer keeps one.

Source

pub fn with_absorber( writer: Box<dyn ArchiveWrite>, archive: &Path, journal: Option<PathBuf>, absorber: Arc<dyn ObjectAbsorb>, ) -> Result<Self>

The same push path whose drain also absorbs object rows.

This is the one a git store builds: push_pack still returns after the two fsyncs and nothing about the ack changes, but the job that leaves on the channel now ends in oids rather than in one pack row.

Source

pub fn name(&self) -> &'static str

The arm’s name, for a bench row.

Source

pub fn durability(&self) -> &'static str

What this arm’s append actually promises.

Source

pub fn push_pack(&self, account: &str, bytes: &[u8]) -> Result<(u64, Extent)>

Store a pushed pack verbatim and queue its index job.

Returns (pack_id, extent). Everything expensive about the pack — parsing it, hashing it, building the tables — happens after this returns.

Source

pub fn indexer(&self, account: &str) -> Arc<AccountIndexer>

This account’s indexer.

Source

pub fn pool(&self) -> &IndexerPool

The pool, for a caller that wants to drain every account.

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.