public void restartFragment ( FragmentResponseMessage message , List < Long > masters , Map < Integer , Long > partitionMastersMap ) { final int partionId = message . getPartitionId ( ) ; Long restartHsid = partitionMastersMap . get ( partionId ) ; Long hsid = message . getExecutorSiteId ( ) ; if ( ! hsid . equals ( restartHsid ) ) { m_masterMapForFragmentRestart . clear ( ) ; m_masterMapForFragmentRestart . put ( restartHsid , hsid ) ; //The very first fragment is to be rerouted to the new leader, then all the follow-up fragments are routed //to new leaders. updateMasters ( masters , partitionMastersMap ) ; } if ( restartHsid == null ) { restartHsid = hsid ; } if ( tmLog . isDebugEnabled ( ) ) { tmLog . debug ( "Rerouted fragment from " + CoreUtils . hsIdToString ( hsid ) + " to " + CoreUtils . hsIdToString ( restartHsid ) + "\n" + m_remoteWork ) ; } m_fragmentRestarted = true ; m_mbox . send ( restartHsid , m_remoteWork ) ; }
Restart this fragment after the fragment is mis - routed from MigratePartitionLeader If the masters have been updated the fragment will be routed to its new master . The fragment will be routed to the old master . until new master is updated .