Class UnreliableFilterInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class UnreliableFilterInputStream
    extends FilterInputStream
    An internal class used solely for the purpose of testing via failure injection.
    • Constructor Detail

      • UnreliableFilterInputStream

        public UnreliableFilterInputStream​(InputStream in,
                                           boolean isFakeIoException)
    • Method Detail

      • getCurrNumErrors

        public int getCurrNumErrors()
      • getMaxNumErrors

        public int getMaxNumErrors()
      • getBytesReadBeforeException

        public int getBytesReadBeforeException()
      • withResetIntervalBeforeException

        public UnreliableFilterInputStream withResetIntervalBeforeException​(int resetIntervalBeforeException)
        Parameters:
        resetIntervalBeforeException - used to control whether an exception would be thrown based on the reset recurrence; not applicable if set to zero. For example, if resetIntervalBeforeException == n, the exception can only be thrown before the n_th reset (or after the n_th minus 1 reset), 2n_th reset (or after the 2n_th minus 1) reset), etc.
      • getResetIntervalBeforeException

        public int getResetIntervalBeforeException()
      • getMarked

        public int getMarked()
      • getPosition

        public int getPosition()
      • isFakeIoException

        public boolean isFakeIoException()
      • getResetCount

        public int getResetCount()