if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
@Override public Boolean get() { try { HAServiceState rm1State = rm1.getAdminService().getServiceStatus().getState(); HAServiceState rm2State = rm2.getAdminService().getServiceStatus().getState(); return (rm1State.equals(HAServiceState.ACTIVE) && rm2State .equals(HAServiceState.STANDBY)) || ( rm1State.equals(HAServiceState.STANDBY) && rm2State .equals(HAServiceState.ACTIVE)); } catch (IOException e) { } return false; } }, 2000, 15000);
@Override public Boolean get() { try { return rm.getAdminService().getServiceStatus().getState() .equals(state); } catch (IOException e) { } return false; } }, 2000, 15000);