@Override public void stopMasters() throws Exception { mMaster.stop(); } }
@Override public void stopMasters() throws Exception { for (int k = 0; k < mNumOfMasters; k++) { mMasters.get(k).stop(); } } }
/** * Iterates over the masters in the order of master creation, stops the first standby master. * * @return true if a standby master is successfully stopped, otherwise, false */ public boolean stopStandby() { for (int k = 0; k < mNumOfMasters; k++) { if (!mMasters.get(k).isServing()) { try { LOG.info("master {} is a standby. stopping it...", k); mMasters.get(k).stop(); LOG.info("master {} stopped.", k); } catch (Exception e) { LOG.error(e.getMessage(), e); return false; } return true; } } return false; }
/** * Iterates over the masters in the order of master creation, stops the leader master. * * @return true if the leader master is successfully stopped, false otherwise */ public boolean stopLeader() { for (int k = 0; k < mNumOfMasters; k++) { if (mMasters.get(k).isServing()) { try { LOG.info("master {} is the leader. stopping it...", k); mMasters.get(k).stop(); LOG.info("master {} stopped.", k); } catch (Exception e) { LOG.error(e.getMessage(), e); return false; } return true; } } return false; }
@Override public void stopMasters() throws Exception { mMaster.stop(); } }
@Override public void stopMasters() throws Exception { for (int k = 0; k < mNumOfMasters; k++) { mMasters.get(k).stop(); } } }
/** * Iterates over the masters in the order of master creation, stops the leader master. * * @return true if the leader master is successfully stopped, false otherwise */ public boolean stopLeader() { for (int k = 0; k < mNumOfMasters; k++) { if (mMasters.get(k).isServing()) { try { LOG.info("master {} is the leader. stopping it...", k); mMasters.get(k).stop(); LOG.info("master {} stopped.", k); } catch (Exception e) { LOG.error(e.getMessage(), e); return false; } return true; } } return false; }
/** * Iterates over the masters in the order of master creation, stops the first standby master. * * @return true if a standby master is successfully stopped, otherwise, false */ public boolean stopStandby() { for (int k = 0; k < mNumOfMasters; k++) { if (!mMasters.get(k).isServing()) { try { LOG.info("master {} is a standby. stopping it...", k); mMasters.get(k).stop(); LOG.info("master {} stopped.", k); } catch (Exception e) { LOG.error(e.getMessage(), e); return false; } return true; } } return false; }