public void checkReplicationDataSanity(Pair<SolrCore,SolrCore> request,ReplicationDiagnostics diagnostics) throws Exception {
  SolrCore replicatedCore=request.getLhs();
  for (int retry=0; retry < 10; retry++) {
    try {
      replicatedCore.loadStatus();
      logger.info("Obtained Core Status successfully " + replicatedCore);
      break;
    }
 catch (    Exception e) {
      logger.info("Encountered Exception while loading core status " + replicatedCore + " Retrying #"+ retry);
      if (retry == 9) {
        if (isCollectionQueryable(replicatedCore)) {
          logger.info("Unable to load core status but able to query core succesfully:" + replicatedCore.name);
          return;
        }
      }
      Thread.sleep(SolrInteractionUtils.DEFAULT_SLEEP_TIME);
    }
  }
  if (!isSourceCoreHealthy(replicatedCore)) {
    if (!replicatorConfig.shouldSkipReplicationFailures()) {
      throw new ReplicationFailureException("Replication Failed due to Replicated Core being unavailable.." + replicatedCore.name);
    }
  }
 else {
    SolrCore bestsrcCore=request.getRhs();
    Pair<Boolean,String> replicationSuccessToReasonPair=bestsrcCore.dataMatch(replicatedCore);
    if (!(replicationSuccessToReasonPair.getLhs())) {
      diagnostics.setEntity(replicatedCore.name);
      diagnostics.setReason(replicationSuccessToReasonPair.getRhs());
      diagnostics.setFailedReplication(true);
      logger.info("Replication Failed: " + diagnostics.getEntity() + " "+ diagnostics.getReason());
      allDiagnostics.add(diagnostics);
      if (!replicatorConfig.shouldSkipReplicationFailures()) {
        throw new ReplicationFailureException("Error Replication Data in core " + replicatedCore.name + " . Reason is "+ replicationSuccessToReasonPair.getRhs());
      }
    }
 else {
      logger.info("Replication Data match succeeded for  " + replicatedCore.name);
    }
  }
}

public void checkReplicationDataSanity ( Pair < SolrCore , SolrCore > request , ReplicationDiagnostics diagnostics ) throws Exception { SolrCore replicatedCore = request . getLhs ( ) ; for ( int retry = 0 ; retry < 10 ; retry ++ ) { try { replicatedCore . loadStatus ( ) ; logger . info ( "Obtained Core Status successfully " + replicatedCore ) ; break ; } catch ( Exception e ) { logger . info ( "Encountered Exception while loading core status " + replicatedCore + " Retrying #" + retry ) ; if ( retry == 9 ) { if ( isCollectionQueryable ( replicatedCore ) ) { logger . info ( "Unable to load core status but able to query core succesfully:" + replicatedCore . name ) ; return ; } } Thread . sleep ( SolrInteractionUtils . DEFAULT_SLEEP_TIME ) ; } } if ( ! isSourceCoreHealthy ( replicatedCore ) ) { if ( ! replicatorConfig . shouldSkipReplicationFailures ( ) ) { throw new ReplicationFailureException ( "Replication Failed due to Replicated Core being unavailable.." + replicatedCore . name ) ; } } else { SolrCore bestsrcCore = request . getRhs ( ) ; Pair < Boolean , String > replicationSuccessToReasonPair = bestsrcCore . dataMatch ( replicatedCore ) ; if ( ! ( replicationSuccessToReasonPair . getLhs ( ) ) ) { diagnostics . setEntity ( replicatedCore . name ) ; diagnostics . setReason ( replicationSuccessToReasonPair . getRhs ( ) ) ; diagnostics . setFailedReplication ( true ) ; logger . info ( "Replication Failed: " + diagnostics . getEntity ( ) + " " + diagnostics . getReason ( ) ) ; allDiagnostics . add ( diagnostics ) ; if ( ! replicatorConfig . shouldSkipReplicationFailures ( ) ) { throw new ReplicationFailureException ( "Error Replication Data in core " + replicatedCore . name + " . Reason is " + replicationSuccessToReasonPair . getRhs ( ) ) ; } } else { logger . info ( "Replication Data match succeeded for  " + replicatedCore . name ) ; } } }
given a replication request , figure out if it is successful . else add diagnostic info
