pub struct ResourceLedger { /* private fields */ }Expand description
Per-query fragment resource ledger. Reservations are RAII: dropping a
ResourcePermit releases its share.
Implementations§
Source§impl ResourceLedger
impl ResourceLedger
Sourcepub fn new(max_fragments: usize, max_bytes: u64) -> Self
pub fn new(max_fragments: usize, max_bytes: u64) -> Self
A ledger admitting at most max_fragments concurrent fragments and
max_bytes total estimated bytes.
Sourcepub fn reserve(
self: &Arc<Self>,
fragment: &PlanFragment,
) -> DistributedResult<ResourcePermit>
pub fn reserve( self: &Arc<Self>, fragment: &PlanFragment, ) -> DistributedResult<ResourcePermit>
Reserves one fragment’s estimated resources (spec section 12.10: “workers reserve resources”).
Sourcepub fn reserved_fragments(&self) -> usize
pub fn reserved_fragments(&self) -> usize
Currently reserved fragment count.
Sourcepub fn reserved_bytes(&self) -> u64
pub fn reserved_bytes(&self) -> u64
Currently reserved estimated bytes.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ResourceLedger
impl !RefUnwindSafe for ResourceLedger
impl Send for ResourceLedger
impl Sync for ResourceLedger
impl Unpin for ResourceLedger
impl UnsafeUnpin for ResourceLedger
impl UnwindSafe for ResourceLedger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more