public static String getConfValueForRMInstance(String prefix, Configuration conf) { String confKey = getConfKeyForRMInstance(prefix, conf); String retVal = conf.getTrimmed(confKey); if (LOG.isTraceEnabled()) { LOG.trace("getConfValueForRMInstance: prefix = " + prefix + "; confKey being looked up = " + confKey + "; value being set to = " + retVal); } return retVal; }
public static String getConfValueForRMInstance(String prefix, Configuration conf) { String confKey = getConfKeyForRMInstance(prefix, conf); String retVal = conf.getTrimmed(confKey); if (LOG.isTraceEnabled()) { LOG.trace("getConfValueForRMInstance: prefix = " + prefix + "; confKey being looked up = " + confKey + "; value being set to = " + retVal); } return retVal; }
public static String getConfValueForRMInstance(String prefix, Configuration conf) { String confKey = getConfKeyForRMInstance(prefix, conf); String retVal = conf.getTrimmed(confKey); if (LOG.isTraceEnabled()) { LOG.trace("getConfValueForRMInstance: prefix = " + prefix + "; confKey being looked up = " + confKey + "; value being set to = " + retVal); } return retVal; }
public static String getConfValueForRMInstance(String prefix, Configuration conf, String host) { String confKey = getConfKeyForRMInstance(prefix, conf, host); String retVal = conf.getTrimmed(confKey); if (LOG.isTraceEnabled()) { LOG.trace("getConfValueForRMInstance: prefix = " + prefix + "; confKey being looked up = " + confKey + "; value being set to = " + retVal); } return retVal; }
public static String getConfValueForRMInstance(String prefix, Configuration conf) { String confKey = getConfKeyForRMInstance(prefix, conf); String retVal = conf.getTrimmed(confKey); if (LOG.isTraceEnabled()) { LOG.trace("getConfValueForRMInstance: prefix = {};" + " confKey being looked up = {};" + " value being set to = {}", prefix, confKey, retVal); } return retVal; }
@Test public void testGetConfKeyForRMInstance() { assertTrue("RM instance id is not suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.RM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); assertFalse("RM instance id is suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.NM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); } }
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); } }
@Test public void testGetConfKeyForRMInstance() { assertTrue("RM instance id is not suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.RM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); assertFalse("RM instance id is suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.NM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); } }
@Test public void testGetConfKeyForRMInstance() { assertTrue("RM instance id is not suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.RM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); assertFalse("RM instance id is suffixed", HAUtil.getConfKeyForRMInstance(YarnConfiguration.NM_ADDRESS, conf) .contains(HAUtil.getRMHAId(conf))); } }
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); } }