void prepareTransferMastership(int newLeaderHostId) {
        if (!m_mastershipAccepted.get()) {
            return;
        }
        m_es.submit(new Runnable() {
            @Override
            public void run() {
                // memorize end sequence number of the most recently pushed buffer from EE
                // but if we already wait to switch mastership, don't update the drain-to
                // sequence number to a greater number
                m_seqNoToDrain = Math.min(m_seqNoToDrain, m_lastPushedSeqNo);
                m_newLeaderHostId = newLeaderHostId;
                // if no new buffer to be drained, send the migrate event right away
                mastershipCheckpoint(m_lastReleasedSeqNo);
            }
        });
    }
void prepareTransferMastership ( int newLeaderHostId ) { if ( ! m_mastershipAccepted . get ( ) ) { return ; } m_es . submit ( new Runnable ( ) { @ Override public void run ( ) { m_seqNoToDrain = Math . min ( m_seqNoToDrain , m_lastPushedSeqNo ) ; m_newLeaderHostId = newLeaderHostId ; mastershipCheckpoint ( m_lastReleasedSeqNo ) ; } } ) ; }
indicate the partition leader has been migrated away
prepare to give up the mastership,
has to drain existing PBD and then notify new leaders (through ack)