Interface DataBrokerFailures
-
- All Known Implementing Classes:
DataBrokerFailuresImpl
public interface DataBrokerFailures
Configures 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 void
failButSubmitsAnyways()
To simulate scenarios where even though the transaction throws a TransactionCommitFailedException (caused by akka.pattern.AskTimeoutException) it eventually succeeds.void
failReads(int howManyTimes, org.opendaylight.mdsal.common.api.ReadFailedException exception)
Fails N future reads.void
failReads(org.opendaylight.mdsal.common.api.ReadFailedException exception)
Fails all future reads.void
failSubmits(int howManyTimes, org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)
Fails N future Transaction submits.void
failSubmits(org.opendaylight.mdsal.common.api.TransactionCommitFailedException exception)
Fails all future Transaction submits.void
unfailReads()
Resets any earlierfailReads(ReadFailedException)
orfailReads(int, ReadFailedException)
.void
unfailSubmits()
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
- aReadFailedException
to 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
- aReadFailedException
to 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)
.
-
-