Interface DataBrokerFailures
-
- All Known Implementing Classes:
DataBrokerFailuresImpl
public interface DataBrokerFailuresConfigures a DataBroker to simulate failures, useful for tests.- Author:
- Michael Vorburger.ch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfailButSubmitsAnyways()To simulate scenarios where even though the transaction throws a TransactionCommitFailedException (caused by akka.pattern.AskTimeoutException) it eventually succeeds.voidfailReads(int howManyTimes, org.opendaylight.mdsal.common.api.ReadFailedException exception)Fails N future reads.voidfailReads(org.opendaylight.mdsal.common.api.ReadFailedException exception)Fails all future reads.voidfailSubmits(int howManyTimes, org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)Fails N future Transaction submits.voidfailSubmits(org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)Fails all future Transaction submits.voidunfailReads()Resets any earlierfailReads(ReadFailedException)orfailReads(int, ReadFailedException).voidunfailSubmits()Resets any earlierfailSubmits(TransactionCommitFailedException)orfailSubmits(int, TransactionCommitFailedException).
-
-
-
Method Detail
-
failReads
void failReads(org.opendaylight.mdsal.common.api.ReadFailedException exception)
Fails all future reads.- Parameters:
exception- aReadFailedExceptionto throw from aReadOperations.read(LogicalDatastoreType, InstanceIdentifier)call.
-
failReads
void failReads(int howManyTimes, org.opendaylight.mdsal.common.api.ReadFailedException exception)Fails N future reads.- Parameters:
howManyTimes- how many times to throw the passed exception, until it resets.exception- aReadFailedExceptionto throw from aReadOperations.read(LogicalDatastoreType, InstanceIdentifier)call.
-
failSubmits
void failSubmits(org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)
Fails all future Transaction submits.- Parameters:
exception- an Exception to throw from aWriteTransaction.commit()(alsoWriteTransaction.commit()) method
-
failSubmits
void failSubmits(int howManyTimes, org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)Fails N future Transaction submits.- Parameters:
howManyTimes- how many times to throw the passed exception, until it resetsexception- an Exception to throw from aWriteTransaction.commit()(alsoWriteTransaction.commit()method
-
failButSubmitsAnyways
void failButSubmitsAnyways()
To simulate scenarios where even though the transaction throws a TransactionCommitFailedException (caused by akka.pattern.AskTimeoutException) it eventually succeeds. These timeouts are typically seen in scaled cluster environments under load. The new tell-based protocol, which will soon be enabled by default (c/61002), adds internal retries for transactions, making the application not to handle such scenarios.
-
unfailReads
void unfailReads()
Resets any earlierfailReads(ReadFailedException)orfailReads(int, ReadFailedException).
-
unfailSubmits
void unfailSubmits()
Resets any earlierfailSubmits(TransactionCommitFailedException)orfailSubmits(int, TransactionCommitFailedException).
-
-