src/java/org/apache/cassandra/service/AntiEntropyService.java
/**
             * Compares our trees, and triggers repairs for any ranges that mismatch.
             */
Compares our trees, and triggers repairs for any ranges that mismatch.
Compares our trees and triggers repairs for any ranges that mismatch .
public void run()
            {
                if (r1.tree.partitioner() == null)
                    r1.tree.partitioner(StorageService.getPartitioner());
                if (r2.tree.partitioner() == null)
                    r2.tree.partitioner(StorageService.getPartitioner());
                differences.addAll(MerkleTree.difference(r1.tree, r2.tree));
                String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", getName(), r1.endpoint, r2.endpoint, cfname);
                if (differences.isEmpty())
                {
                    logger.info(String.format(format, "are consistent"));
                    completed(this);
                    return;
                }
                logger.info(String.format(format, "have " + differences.size() + " range(s) out of sync"));
                performStreamingRepair();
            }
public void run ( ) { if ( r1 . tree . partitioner ( ) == null ) r1 . tree . partitioner ( StorageService . getPartitioner ( ) ) ; if ( r2 . tree . partitioner ( ) == null ) r2 . tree . partitioner ( StorageService . getPartitioner ( ) ) ; differences . addAll ( MerkleTree . difference ( r1 . tree , r2 . tree ) ) ; String format = String . format ( "[repair #%s] Endpoints %s and %s %%s for %s" , getName ( ) , r1 . endpoint , r2 . endpoint , cfname ) ; if ( differences . isEmpty ( ) ) { logger . info ( String . format ( format , "are consistent" ) ) ; completed ( this ) ; return ; } 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.
Compares our trees and triggers repairs for any ranges that mismatch .
// restore partitioners (in case we were serialized) // compare trees, and collect differences // choose a repair method based on the significance of the difference // non-0 difference: perform streaming repair