private void checkReadSequence ( long sequence ) { final long tailSequence = ringbuffer . tailSequence ( ) ; if ( sequence > tailSequence ) { throw new IllegalArgumentException ( "sequence:" + sequence + " is too large. The current tailSequence is:" + tailSequence ) ; } if ( isStaleSequence ( sequence ) ) { throw new StaleSequenceException ( "sequence:" + sequence + " is too small and data store is disabled." + " The current headSequence is:" + headSequence ( ) + " tailSequence is:" + tailSequence , headSequence ( ) ) ; } }
Check if the sequence can be read from the ring buffer .