backtype.storm.utils.Utils.findAndReadConfigFile()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中backtype.storm.utils.Utils.findAndReadConfigFile()方法的一些代码示例,展示了Utils.findAndReadConfigFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.findAndReadConfigFile()方法的具体详情如下:
包路径:backtype.storm.utils.Utils
类名称:Utils
方法名:findAndReadConfigFile

Utils.findAndReadConfigFile介绍

暂无

代码示例

代码示例来源:origin: alibaba/mdrill

public static Map read_yaml_config(String name) {
  return Utils.findAndReadConfigFile(name, true);
}

代码示例来源:origin: alibaba/mdrill

public static Map readDefaultConfig() {
  return findAndReadConfigFile("defaults.yaml", true);
}

代码示例来源:origin: alibaba/mdrill

public static Map findAndReadConfigFile(String name) {
  return findAndReadConfigFile(name, true);
}

代码示例来源:origin: alibaba/mdrill

public static Map readStormConfig() {
  Map ret = readDefaultConfig();
  Map storm = findAndReadConfigFile("storm.yaml", false);
  ret.putAll(storm);
  return ret;
}

代码示例来源:origin: alibaba/mdrill

public static Map readStormConfig(String filename) {
  Map ret = readStormConfig();
  Map storm = findAndReadConfigFile(filename, false);
  ret.putAll(storm);
  return ret;
}

代码示例来源:origin: alibaba/jstorm

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;
}

代码示例来源:origin: XiaoMi/galaxy-sdk-java

public static Map getTopologyConfig(String confFile) {
    return backtype.storm.utils.Utils.findAndReadConfigFile(confFile, true);
  }
}

代码示例来源:origin: com.n3twork.storm/storm-core

public static Map readDefaultConfig() {
  return findAndReadConfigFile("defaults.yaml", true);
}

代码示例来源:origin: com.n3twork.storm/storm-core

public static Map findAndReadConfigFile(String name) {
  return findAndReadConfigFile(name, true);
}

代码示例来源:origin: com.n3twork.storm/storm-core

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;
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

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;
}

相关文章