Class StaleSequenceException

  • All Implemented Interfaces:
    SilentException, com.hazelcast.spi.impl.operationservice.WrappableException<StaleSequenceException>, java.io.Serializable

    public class StaleSequenceException
    extends java.lang.RuntimeException
    implements SilentException, com.hazelcast.spi.impl.operationservice.WrappableException<StaleSequenceException>
    An RuntimeException that is thrown when accessing an item in the Ringbuffer using a sequence that is smaller than the current head sequence and that the ringbuffer store is disabled. This means that the item isn't available in the ringbuffer and it cannot be loaded from the store either, thus being completely unavailable.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StaleSequenceException​(java.lang.String message, long headSeq)
      Creates a StaleSequenceException with the given message.
      StaleSequenceException​(java.lang.String message, long headSeq, java.lang.Throwable cause)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getHeadSeq()
      Returns the last known head sequence.
      StaleSequenceException wrap()
      Returns a new exception of the same type as this exception, using this exception as its cause.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StaleSequenceException

        public StaleSequenceException​(java.lang.String message,
                                      long headSeq)
        Creates a StaleSequenceException with the given message.
        Parameters:
        message - the message
        headSeq - the last known head sequence.
      • StaleSequenceException

        public StaleSequenceException​(java.lang.String message,
                                      long headSeq,
                                      java.lang.Throwable cause)
    • Method Detail

      • getHeadSeq

        public long getHeadSeq()
        Returns the last known head sequence. Beware that this sequence could already be stale again if you want to use it to do a Ringbuffer.readOne(long).
        Returns:
        last known head sequence.
      • wrap

        public StaleSequenceException wrap()
        Description copied from interface: com.hazelcast.spi.impl.operationservice.WrappableException
        Returns a new exception of the same type as this exception, using this exception as its cause. This is useful when this is a remote or async exception, because its stack trace is disconnected from the client code that handles the exception. The returned exception includes all the state of this exception, while providing the local stack trace and the remote/async stack trace in its cause.
        Specified by:
        wrap in interface com.hazelcast.spi.impl.operationservice.WrappableException<StaleSequenceException>
        Returns:
        a new WrappableException with this as its cause.