private synchronized void stopRelayLogs(){
  if (relayLogTask == null || relayLogTask.isFinished())   return;
  logger.info("Cancelling relay log thread");
  relayLogTask.cancel();
  relayLogThread.interrupt();
  try {
    relayLogThread.join(2000);
  }
 catch (  InterruptedException e) {
    logger.warn("Interrupted while waiting for relay log task to complete");
  }
  if (relayLogTask.isFinished()) {
    relayLogTask=null;
    relayLogThread=null;
    relayLogQueue=null;
  }
 else   logger.warn("Unable to cancel relay log thread");
}

private synchronized void stopRelayLogs ( ) { if ( relayLogTask == null || relayLogTask . isFinished ( ) ) return ; logger . info ( "Cancelling relay log thread" ) ; relayLogTask . cancel ( ) ; relayLogThread . interrupt ( ) ; try { relayLogThread . join ( 2000 ) ; } catch ( InterruptedException e ) { logger . warn ( "Interrupted while waiting for relay log task to complete" ) ; } if ( relayLogTask . isFinished ( ) ) { relayLogTask = null ; relayLogThread = null ; relayLogQueue = null ; } else logger . warn ( "Unable to cancel relay log thread" ) ; }
stops relay log operation .
