Package me.ahoo.cosid.store.tck
Class FaultInjector
java.lang.Object
me.ahoo.cosid.store.tck.FaultInjector
The faults a
FaultyRangeStore or FaultySlotLeaseStore applies, per operation: one-shot faults in the
order they were queued, then the standing fault if any. Thread-safe.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalways(FaultInjector.Operation operation, Fault fault) longcalls(FaultInjector.Operation operation) How many calls ofoperationreached the wrapped store.voidclear()Removes every fault.once(FaultInjector.Operation operation, Fault fault) Appliesfaultto the next call ofoperationonly.
-
Constructor Details
-
FaultInjector
public FaultInjector()An injector without faults.
-
-
Method Details
-
once
Appliesfaultto the next call ofoperationonly.- Parameters:
operation- the operationfault- the fault- Returns:
- this injector
-
always
- Parameters:
operation- the operationfault- the fault- Returns:
- this injector
-
clear
public void clear()Removes every fault. -
calls
How many calls ofoperationreached the wrapped store.- Parameters:
operation- the operation- Returns:
- the count
-