private void reconnectZKToActiveSite(){
  LocalRepository localRepository=LocalRepository.getInstance();
  try {
    boolean allEntered=switchToZkObserverBarrier.enter(DR_SWITCH_BARRIER_TIMEOUT,TimeUnit.SECONDS);
    if (allEntered) {
      try {
        localRepository.reconfigCoordinator("observer");
      }
  finally {
        leaveZKDoubleBarrier(switchToZkObserverBarrier,DR_SWITCH_TO_ZK_OBSERVER_BARRIER);
      }
      localRepository.restartCoordinator("observer");
    }
 else {
      log.warn("All nodes unable to enter barrier {}. Try again later",DR_SWITCH_TO_ZK_OBSERVER_BARRIER);
    }
  }
 catch (  Exception ex) {
    log.warn("Unexpected errors during switching back to zk observer. Try again later. {}",ex);
  }
}

private void reconnectZKToActiveSite ( ) { LocalRepository localRepository = LocalRepository . getInstance ( ) ; try { boolean allEntered = switchToZkObserverBarrier . enter ( DR_SWITCH_BARRIER_TIMEOUT , TimeUnit . SECONDS ) ; if ( allEntered ) { try { localRepository . reconfigCoordinator ( "observer" ) ; } finally { leaveZKDoubleBarrier ( switchToZkObserverBarrier , DR_SWITCH_TO_ZK_OBSERVER_BARRIER ) ; } localRepository . restartCoordinator ( "observer" ) ; } else { log . warn ( "All nodes unable to enter barrier {}. Try again later" , DR_SWITCH_TO_ZK_OBSERVER_BARRIER ) ; } } catch ( Exception ex ) { log . warn ( "Unexpected errors during switching back to zk observer. Try again later. {}" , ex ) ; } }
reconnect to zookeeper in active site .
