@Test public void testGetConfValue() throws Exception { ConfVariable confVariable = new ConfVariable("${conf:streaming.storm.worker.number}"); String value = ConfVariable.getValue(confVariable, config, null); assertEquals(value, "1"); }
private static String getConfValue(String name, Map<String, Object> conf, Map<String, String> userConf) throws StreamingException { if (userConf != null && userConf.containsKey(name)) { return userConf.get(name); } if (conf != null && conf.containsKey(name)) { return conf.get(name).toString(); } StreamingException exception = new StreamingException(ErrorCode.CONFIG_NOT_FOUND, name); LOG.error(exception.getMessage(), exception); throw exception; }
ConfVariable { private static String getConfValue(String name, Map<String, Object> conf, Map<String, String> userConf) throws StreamingException { if (userConf != null && userConf.containsKey(name)) { return userConf.get(name); } if (conf != null && conf.containsKey(name)) { return conf.get(name).toString(); } StreamingException exception = new StreamingException(ErrorCode.CONFIG_NOT_FOUND, name); LOG.error(exception.getMessage(), exception); throw exception; } }
ConfVariable { private static String getConfValue(String name, Map<String, Object> conf, Map<String, String> userConf) throws StreamingException { if (userConf != null && userConf.containsKey(name)) { return userConf.get(name); } if (conf != null && conf.containsKey(name)) { return conf.get(name).toString(); } StreamingException exception = new StreamingException(ErrorCode.CONFIG_NOT_FOUND, name); LOG.error(exception.getMessage(), exception); throw exception; } ConfVariable(final String value); }
ConfVariable { private static String getConfValue(String name, Map<String, Object> conf, Map<String, String> userConf) throws StreamingException { if (userConf != null && userConf.containsKey(name)) { return userConf.get(name); } if (conf != null && conf.containsKey(name)) { return conf.get(name).toString(); } StreamingException exception = new StreamingException(ErrorCode.CONFIG_NOT_FOUND, name); LOG.error(exception.getMessage(), exception); throw exception; } ConfVariable(final String value); static String getValue(ConfVariable confVariable, Map<String, Object> conf, Map<String, String> userConf); static String getKey(ConfVariable confVariable, Map<String, Object> conf, Map<String, String> userConf); String getName(); void setName(String name); ConfValueType getType(); void setType(ConfValueType type); String getPreStr(); String getPostStr(); }
ConfVariable { private static String getConfValue(String name, Map<String, Object> conf, Map<String, String> userConf) throws StreamingException { if (userConf != null && userConf.containsKey(name)) { return userConf.get(name); } if (conf != null && conf.containsKey(name)) { return conf.get(name).toString(); } StreamingException exception = new StreamingException(ErrorCode.CONFIG_NOT_FOUND, name); LOG.error(exception.getMessage(), exception); throw exception; } ConfVariable(final String value); static String getValue(ConfVariable confVariable, Map<String, Object> conf, Map<String, String> userConf); static String getKey(ConfVariable confVariable, Map<String, Object> conf, Map<String, String> userConf); String getName(); void setName(String name); ConfValueType getType(); void setType(ConfValueType type); String getPreStr(); String getPostStr(); static final String CONF_VARIABLE_PREFIX; static final String CONF_VARIABLE_POSTFIX; static final String SYSTEM_PREFIX; static final String CQLCONF_PREFIX; }