private void rollback ( final short vbucket , final long toSeqno ) { final Queue < BufferedEvent > queue = partitionQueues . get ( vbucket ) ; synchronized ( queue ) { for ( Iterator < BufferedEvent > i = queue . iterator ( ) ; i . hasNext ( ) ; ) { final BufferedEvent event = i . next ( ) ; final boolean eventSeqnoIsGreaterThanRollbackSeqno = Long . compareUnsigned ( event . seqno , toSeqno ) > 0 ; if ( eventSeqnoIsGreaterThanRollbackSeqno ) { LOGGER . trace ( "Dropping event with seqno {} from stream buffer for partition {}" , event . seqno , vbucket ) ; event . discard ( ) ; i . remove ( ) ; } } } }
Discard any buffered events in the given vBucket with sequence numbers higher than the given sequence number .