pub struct StatelessServicePartitionMock { /* private fields */ }Expand description
Mock for IStatelessServicePartition Currently does not react to any reports
Implementations§
Source§impl StatelessServicePartitionMock
impl StatelessServicePartitionMock
Sourcepub fn new(info: ServicePartitionInformation) -> Self
pub fn new(info: ServicePartitionInformation) -> Self
Create a new mock with given partition info
pub fn new_arc( info: ServicePartitionInformation, ) -> Arc<dyn IStatelessServicePartition>
Trait Implementations§
Source§impl IStatelessServicePartition for StatelessServicePartitionMock
impl IStatelessServicePartition for StatelessServicePartitionMock
fn get_partition_info(&self) -> Result<ServicePartitionInformation>
Source§fn report_load(&self, _metrics: &[LoadMetric]) -> Result<()>
fn report_load(&self, _metrics: &[LoadMetric]) -> Result<()>
Reports load for the current replica in the partition.
Remarks:
The reported metrics should correspond to those that are provided in the ServiceLoadMetricDescription
as a part of the ServiceDescription that is used to create the service. Load metrics that are not
present in the description are ignored. Reporting custom metrics allows Service Fabric to balance
services that are based on additional custom information.
Source§fn report_fault(&self, _fault_type: FaultType) -> Result<()>
fn report_fault(&self, _fault_type: FaultType) -> Result<()>
Enables the replica to report a fault to the runtime and indicates that it has encountered
an error from which it cannot recover and must either be restarted or removed.
Source§fn report_move_cost(&self, _move_cost: MoveCost) -> Result<()>
fn report_move_cost(&self, _move_cost: MoveCost) -> Result<()>
Reports the move cost for a replica.
Remarks:
Services can report move cost of a replica using this method.
While the Service Fabric Resource Balances searches for the best balance in the cluster,
it examines both load information and move cost of each replica.
Resource balances will prefer to move replicas with lower cost in order to achieve balance.
Source§fn report_partition_health(&self, _healthinfo: &HealthInformation) -> Result<()>
fn report_partition_health(&self, _healthinfo: &HealthInformation) -> Result<()>
Reports current partition health.
Source§fn report_instance_health(&self, _health_info: &HealthInformation) -> Result<()>
fn report_instance_health(&self, _health_info: &HealthInformation) -> Result<()>
Reports health on the current stateless service instance of the partition.
Auto Trait Implementations§
impl Freeze for StatelessServicePartitionMock
impl RefUnwindSafe for StatelessServicePartitionMock
impl Send for StatelessServicePartitionMock
impl Sync for StatelessServicePartitionMock
impl Unpin for StatelessServicePartitionMock
impl UnsafeUnpin for StatelessServicePartitionMock
impl UnwindSafe for StatelessServicePartitionMock
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