pub struct PriorityMap {
map: Box<dyn ArrowHashTable + Send>,
heap: Box<dyn ArrowHeap + Send>,
capacity: usize,
mapper: Vec<(usize, usize)>,
}Expand description
A Map<K, V> / PriorityQueue combo that evicts the worst values after reaching capacity
Fields§
§map: Box<dyn ArrowHashTable + Send>§heap: Box<dyn ArrowHeap + Send>§capacity: usize§mapper: Vec<(usize, usize)>Implementations§
Source§impl PriorityMap
impl PriorityMap
pub fn new( key_type: DataType, val_type: DataType, capacity: usize, descending: bool, ) -> Result<Self>
pub fn set_batch(&mut self, ids: ArrayRef, vals: ArrayRef)
pub fn insert(&mut self, row_idx: usize) -> Result<()>
pub fn emit(&mut self) -> Result<Vec<ArrayRef>>
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for PriorityMap
impl !RefUnwindSafe for PriorityMap
impl Send for PriorityMap
impl !Sync for PriorityMap
impl Unpin for PriorityMap
impl !UnwindSafe for PriorityMap
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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