@Override
 public void onElectionWithdrawn(ZooKeeperElection election) {
   logger.warn("Unexpected withdrawal from master election, going on standby and re-enrolling");
   changeFailoverState(FailoverState.STANDBY);
   masterElection.enroll(this);
 }
 @Override
 public void onConnectionStateChanged(ZooKeeperConnectionState state) {
   if (state == ZooKeeperConnectionState.INITIALIZED) {
     masterElection.enroll(this);
   }
 }