pub struct PartitionManager { /* private fields */ }Expand description
Cache partitioning manager
Implementations§
Source§impl PartitionManager
impl PartitionManager
Sourcepub async fn add_partition(&self, partition: Partition) -> Result<()>
pub async fn add_partition(&self, partition: Partition) -> Result<()>
Add partition
Sourcepub async fn remove_partition(&self, partition_id: &str) -> Result<()>
pub async fn remove_partition(&self, partition_id: &str) -> Result<()>
Remove partition
Sourcepub async fn assign_key(
&self,
key: CacheKey,
partition_id: String,
size: usize,
) -> Result<()>
pub async fn assign_key( &self, key: CacheKey, partition_id: String, size: usize, ) -> Result<()>
Assign key to partition
Sourcepub async fn remove_key(&self, key: &CacheKey, size: usize) -> Result<()>
pub async fn remove_key(&self, key: &CacheKey, size: usize) -> Result<()>
Remove key from partition
Sourcepub async fn get_partition(&self, key: &CacheKey) -> Option<String>
pub async fn get_partition(&self, key: &CacheKey) -> Option<String>
Get partition for key
Sourcepub async fn record_hit(&self, partition_id: &str, access_time_us: u64)
pub async fn record_hit(&self, partition_id: &str, access_time_us: u64)
Record cache hit
Sourcepub async fn record_miss(&self, partition_id: &str)
pub async fn record_miss(&self, partition_id: &str)
Record cache miss
Sourcepub async fn record_eviction(&self, partition_id: &str)
pub async fn record_eviction(&self, partition_id: &str)
Record eviction
Sourcepub async fn get_stats(&self, partition_id: &str) -> Option<PartitionStats>
pub async fn get_stats(&self, partition_id: &str) -> Option<PartitionStats>
Get partition statistics
Sourcepub async fn get_all_partitions(&self) -> Vec<Partition>
pub async fn get_all_partitions(&self) -> Vec<Partition>
Get all partition info
Auto Trait Implementations§
impl Freeze for PartitionManager
impl !RefUnwindSafe for PartitionManager
impl Send for PartitionManager
impl Sync for PartitionManager
impl Unpin for PartitionManager
impl UnsafeUnpin for PartitionManager
impl !UnwindSafe for PartitionManager
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
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