Interface DataBrokerFailures

  • All Known Implementing Classes:
    DataBrokerFailuresImpl

    public interface DataBrokerFailures
    Configures a DataBroker to simulate failures, useful for tests.
    Author:
    Michael Vorburger.ch
    • Method Detail

      • failReads

        void failReads​(org.opendaylight.mdsal.common.api.ReadFailedException exception)
        Fails all future reads.
        Parameters:
        exception - a ReadFailedException to throw from a ReadOperations.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 - a ReadFailedException to throw from a ReadOperations.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 a WriteTransaction.commit() (also WriteTransaction.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 resets
        exception - an Exception to throw from a WriteTransaction.commit() (also WriteTransaction.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.