private static void verifyAndSetConfValue(String prefix, Configuration conf) { String confKey = null; String confValue = null; try { confKey = getConfKeyForRMInstance(prefix, conf); confValue = getConfValueForRMInstance(prefix, conf); conf.set(prefix, confValue); } catch (YarnRuntimeException yre) { // Error at getRMHAId() throw yre; } catch (IllegalArgumentException iae) { String errmsg; if (confKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, getRMHAId(conf)); } else { // Error at Configuration#set. errmsg = getNeedToSetValueMessage(confKey); } throwBadConfigurationException(errmsg); } }
private static void verifyAndSetConfValue(String prefix, Configuration conf) { String confKey = null; String confValue = null; try { confKey = getConfKeyForRMInstance(prefix, conf); confValue = getConfValueForRMInstance(prefix, conf); conf.set(prefix, confValue); } catch (YarnRuntimeException yre) { // Error at getRMHAId() throw yre; } catch (IllegalArgumentException iae) { String errmsg; if (confKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, getRMHAId(conf)); } else { // Error at Configuration#set. errmsg = getNeedToSetValueMessage(confKey); } throwBadConfigurationException(errmsg); } }
private static void verifyAndSetConfValue(String prefix, Configuration conf) { String confKey = null; String confValue = null; try { confKey = getConfKeyForRMInstance(prefix, conf); confValue = getConfValueForRMInstance(prefix, conf); conf.set(prefix, confValue); } catch (YarnRuntimeException yre) { // Error at getRMHAId() throw yre; } catch (IllegalArgumentException iae) { String errmsg; if (confKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, getRMHAId(conf)); } else { // Error at Configuration#set. errmsg = getNeedToSetValueMessage(confKey); } throwBadConfigurationException(errmsg); } }
private static void verifyAndSetConfValue(String prefix, Configuration conf) { String confKey = null; String confValue = null; try { confKey = getConfKeyForRMInstance(prefix, conf); confValue = getConfValueForRMInstance(prefix, conf); conf.set(prefix, confValue); } catch (YarnRuntimeException yre) { // Error at getRMHAId() throw yre; } catch (IllegalArgumentException iae) { String errmsg; if (confKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, getRMHAId(conf)); } else { // Error at Configuration#set. errmsg = getNeedToSetValueMessage(confKey); } throwBadConfigurationException(errmsg); } }
private static void checkAndSetRMRPCAddress(String prefix, String RMId, Configuration conf) { String rpcAddressConfKey = null; try { rpcAddressConfKey = addSuffix(prefix, RMId); if (conf.getTrimmed(rpcAddressConfKey) == null) { String hostNameConfKey = addSuffix(YarnConfiguration.RM_HOSTNAME, RMId); String confVal = conf.getTrimmed(hostNameConfKey); if (confVal == null) { throwBadConfigurationException(getNeedToSetValueMessage( hostNameConfKey + " or " + addSuffix(prefix, RMId))); } else { conf.set(addSuffix(prefix, RMId), confVal + ":" + YarnConfiguration.getRMDefaultPortNumber(prefix, conf)); } } } catch (IllegalArgumentException iae) { String errmsg = iae.getMessage(); if (rpcAddressConfKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, RMId); } throwBadConfigurationException(errmsg); } } }
private static void checkAndSetRMRPCAddress(String prefix, String RMId, Configuration conf) { String rpcAddressConfKey = null; try { rpcAddressConfKey = addSuffix(prefix, RMId); if (conf.getTrimmed(rpcAddressConfKey) == null) { String hostNameConfKey = addSuffix(YarnConfiguration.RM_HOSTNAME, RMId); String confVal = conf.getTrimmed(hostNameConfKey); if (confVal == null) { throwBadConfigurationException(getNeedToSetValueMessage( hostNameConfKey + " or " + addSuffix(prefix, RMId))); } else { conf.set(addSuffix(prefix, RMId), confVal + ":" + YarnConfiguration.getRMDefaultPortNumber(prefix, conf)); } } } catch (IllegalArgumentException iae) { String errmsg = iae.getMessage(); if (rpcAddressConfKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, RMId); } throwBadConfigurationException(errmsg); } } }
private static void checkAndSetRMRPCAddress(String prefix, String RMId, Configuration conf) { String rpcAddressConfKey = null; try { rpcAddressConfKey = addSuffix(prefix, RMId); if (conf.getTrimmed(rpcAddressConfKey) == null) { String hostNameConfKey = addSuffix(YarnConfiguration.RM_HOSTNAME, RMId); String confVal = conf.getTrimmed(hostNameConfKey); if (confVal == null) { throwBadConfigurationException(getNeedToSetValueMessage( hostNameConfKey + " or " + addSuffix(prefix, RMId))); } else { conf.set(addSuffix(prefix, RMId), confVal + ":" + YarnConfiguration.getRMDefaultPortNumber(prefix, conf)); } } } catch (IllegalArgumentException iae) { String errmsg = iae.getMessage(); if (rpcAddressConfKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, RMId); } throwBadConfigurationException(errmsg); } } }
private static void checkAndSetRMRPCAddress(String prefix, String RMId, Configuration conf) { String rpcAddressConfKey = null; try { rpcAddressConfKey = addSuffix(prefix, RMId); if (conf.getTrimmed(rpcAddressConfKey) == null) { String hostNameConfKey = addSuffix(YarnConfiguration.RM_HOSTNAME, RMId); String confVal = conf.getTrimmed(hostNameConfKey); if (confVal == null) { throwBadConfigurationException(getNeedToSetValueMessage( hostNameConfKey + " or " + addSuffix(prefix, RMId))); } else { conf.set(addSuffix(prefix, RMId), confVal + ":" + YarnConfiguration.getRMDefaultPortNumber(prefix, conf)); } } } catch (IllegalArgumentException iae) { String errmsg = iae.getMessage(); if (rpcAddressConfKey == null) { // Error at addSuffix errmsg = getInvalidValueMessage(YarnConfiguration.RM_HA_ID, RMId); } throwBadConfigurationException(errmsg); } } }
assertEquals("YarnRuntimeException by getRMId()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage(YarnConfiguration.RM_HA_ID), e.getMessage()); HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM1_NODE_ID); assertEquals("YarnRuntimeException by Configuration#set()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage( HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, RM1_NODE_ID) + " or " + confKey), e.getMessage());
assertEquals("YarnRuntimeException by getRMId()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage(YarnConfiguration.RM_HA_ID), e.getMessage()); HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM1_NODE_ID); assertEquals("YarnRuntimeException by Configuration#set()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage( HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, RM1_NODE_ID) + " or " + confKey), e.getMessage());
assertEquals("YarnRuntimeException by getRMId()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage(YarnConfiguration.RM_HA_ID), e.getMessage()); HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM1_NODE_ID); assertEquals("YarnRuntimeException by Configuration#set()", HAUtil.BAD_CONFIG_MESSAGE_PREFIX + HAUtil.getNeedToSetValueMessage( HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, RM1_NODE_ID) + " or " + confKey), e.getMessage());