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.controller.md.sal.common.api.data.ReadFailedException exception)
        Fails all future reads.
        Parameters:
        exception - a ReadFailedException to throw from a ReadTransaction.read(LogicalDatastoreType, InstanceIdentifier) call.
      • failReads

        void failReads​(int howManyTimes,
                       org.opendaylight.controller.md.sal.common.api.data.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 ReadTransaction.read(LogicalDatastoreType, InstanceIdentifier) call.
      • failSubmits

        void failSubmits​(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException exception)
        Fails all future Transaction submits.
        Parameters:
        exception - an Exception to throw from a AsyncWriteTransaction.submit() (also AsyncWriteTransaction.submit()) method
      • failSubmits

        void failSubmits​(int howManyTimes,
                         org.opendaylight.controller.md.sal.common.api.data.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 AsyncWriteTransaction.submit() (also AsyncWriteTransaction.submit()) 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.