public static Map read_yaml_config(String name) { return Utils.findAndReadConfigFile(name, true); }
public static Map readDefaultConfig() { return findAndReadConfigFile("defaults.yaml", true); }
public static Map findAndReadConfigFile(String name) { return findAndReadConfigFile(name, true); }
public static Map readStormConfig() { Map ret = readDefaultConfig(); Map storm = findAndReadConfigFile("storm.yaml", false); ret.putAll(storm); return ret; }
public static Map readStormConfig(String filename) { Map ret = readStormConfig(); Map storm = findAndReadConfigFile(filename, false); ret.putAll(storm); return ret; }
protected Map<String, AclFunctionEntry> readAclFromConfig() { // Thread safety is mostly around _acl. If _acl needs to be updated it is changed atomically // More then one thread may be trying to update it at a time, but that is OK, because the // change is atomic long now = System.currentTimeMillis(); if ((now - 5000) > _lastUpdate || _acl == null) { Map<String, AclFunctionEntry> acl = new HashMap<String, AclFunctionEntry>(); Map conf = Utils.findAndReadConfigFile(_aclFileName); if (conf.containsKey(Config.DRPC_AUTHORIZER_ACL)) { Map<String, Map<String, ?>> confAcl = (Map<String, Map<String, ?>>) conf.get(Config.DRPC_AUTHORIZER_ACL); for (String function : confAcl.keySet()) { Map<String, ?> val = confAcl.get(function); Collection<String> clientUsers = val.containsKey(CLIENT_USERS_KEY) ? (Collection<String>) val.get(CLIENT_USERS_KEY) : null; String invocationUser = val.containsKey(INVOCATION_USER_KEY) ? (String) val.get(INVOCATION_USER_KEY) : null; acl.put(function, new AclFunctionEntry(clientUsers, invocationUser)); } } else if (!_permitWhenMissingFunctionEntry) { LOG.warn("Requiring explicit ACL entries, but none given. " + "Therefore, all operiations will be denied."); } _acl = acl; _lastUpdate = System.currentTimeMillis(); } return _acl; }
public static Map getTopologyConfig(String confFile) { return backtype.storm.utils.Utils.findAndReadConfigFile(confFile, true); } }
public static Map readDefaultConfig() { return findAndReadConfigFile("defaults.yaml", true); }
public static Map findAndReadConfigFile(String name) { return findAndReadConfigFile(name, true); }
public static Map readStormConfig() { Map ret = readDefaultConfig(); String confFile = System.getProperty("storm.conf.file"); Map storm; if (confFile==null || confFile.equals("")) { storm = findAndReadConfigFile("storm.yaml", false); } else { storm = findAndReadConfigFile(confFile, true); } ret.putAll(storm); ret.putAll(readCommandLineOpts()); return ret; }
protected Map<String, AclFunctionEntry> readAclFromConfig() { // Thread safety is mostly around _acl. If _acl needs to be updated it is changed atomically // More then one thread may be trying to update it at a time, but that is OK, because the // change is atomic long now = System.currentTimeMillis(); if ((now - 5000) > _lastUpdate || _acl == null) { Map<String, AclFunctionEntry> acl = new HashMap<String, AclFunctionEntry>(); Map conf = Utils.findAndReadConfigFile(_aclFileName); if (conf.containsKey(Config.DRPC_AUTHORIZER_ACL)) { Map<String, Map<String, ?>> confAcl = (Map<String, Map<String, ?>>) conf.get(Config.DRPC_AUTHORIZER_ACL); for (String function : confAcl.keySet()) { Map<String, ?> val = confAcl.get(function); Collection<String> clientUsers = val.containsKey(CLIENT_USERS_KEY) ? (Collection<String>) val.get(CLIENT_USERS_KEY) : null; String invocationUser = val.containsKey(INVOCATION_USER_KEY) ? (String) val.get(INVOCATION_USER_KEY) : null; acl.put(function, new AclFunctionEntry(clientUsers, invocationUser)); } } else if (!_permitWhenMissingFunctionEntry) { LOG.warn("Requiring explicit ACL entries, but none given. " + "Therefore, all operiations will be denied."); } _acl = acl; _lastUpdate = System.currentTimeMillis(); } return _acl; }