class RaftLogShipper {

    public synchronized void onMismatch( long lastRemoteAppendIndex, LeaderContext leaderContext )
    {
        switch ( mode )
        {
            case MISMATCH:
                long logIndex = max( min( lastSentIndex - 1, lastRemoteAppendIndex ), MIN_INDEX );
                sendEmpty( logIndex, leaderContext );
                break;
            case PIPELINE:
            case CATCHUP:
                log.info( "%s: mismatch in mode %s from follower %s, moving to MISMATCH mode",
                        statusAsString(), mode, follower );
                mode = Mode.MISMATCH;
                sendEmpty( lastSentIndex, leaderContext );
                break;

            default:
                throw new IllegalStateException( "Unknown mode: " + mode );
        }

        lastLeaderContext = leaderContext;
    }

      RaftLogShipper( Outbound<MemberId, RaftMessages.RaftMessage> outbound, LogProvider logProvider,
                    ReadableRaftLog raftLog, Clock clock, TimerService timerService,
                    MemberId leader, MemberId follower, long leaderTerm, long leaderCommit, long retryTimeMillis,
                    int catchupBatchSize, int maxAllowedShippingLag, InFlightCache inFlightCache );

}