public void run ( ) { // compare trees, and collect differences differences . addAll ( MerkleTree . difference ( r1 . tree , r2 . tree ) ) ; // choose a repair method based on the significance of the difference String format = String . format ( "[repair #%s] Endpoints %s and %s %%s for %s" , desc . sessionId , r1 . endpoint , r2 . endpoint , desc . columnFamily ) ; if ( differences . isEmpty ( ) ) { logger . info ( String . format ( format , "are consistent" ) ) ; // send back sync complete message MessagingService . instance ( ) . sendOneWay ( new SyncComplete ( desc , r1 . endpoint , r2 . endpoint , true ) . createMessage ( ) , FBUtilities . getLocalAddress ( ) ) ; return ; } // non-0 difference: perform streaming repair logger . info ( String . format ( format , "have " + differences . size ( ) + " range(s) out of sync" ) ) ; performStreamingRepair ( ) ; }
Compares our trees and triggers repairs for any ranges that mismatch .