private void addToken ( final MutationToken token ) { if ( token != null ) { ListIterator < MutationToken > tokenIterator = tokens . listIterator ( ) ; while ( tokenIterator . hasNext ( ) ) { MutationToken t = tokenIterator . next ( ) ; if ( t . vbucketID ( ) == token . vbucketID ( ) && t . bucket ( ) . equals ( token . bucket ( ) ) ) { if ( token . sequenceNumber ( ) > t . sequenceNumber ( ) ) { tokenIterator . set ( token ) ; } return ; } } tokens . add ( token ) ; } }
Helper method to check the incoming token and store it if needed .