org.apache.storm.utils.Utils.fromCompressedJsonConf()方法的使用及代码示例

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

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

Utils.fromCompressedJsonConf介绍

暂无

代码示例

代码示例来源:origin: apache/storm

public static Map<String, Object> readSupervisorStormConfGivenPath(Map<String, Object> conf, String topoConfPath) throws IOException {
  Map<String, Object> ret = new HashMap<>(conf);
  ret.putAll(Utils.fromCompressedJsonConf(FileUtils.readFileToByteArray(new File(topoConfPath))));
  return ret;
}

代码示例来源:origin: apache/storm

/**
 * Read a topology conf.
 * @param topoId the id of the topology to read the conf for
 * @param who who to read it as
 * @return the deserialized config.
 * @throws IOException on any error while reading the blob.
 * @throws AuthorizationException if who is not allowed to read the blob
 * @throws KeyNotFoundException if the blob could not be found
 */
public Map<String, Object> readTopoConf(final String topoId, final Subject who)
  throws KeyNotFoundException, AuthorizationException, IOException {
  final String key = ConfigUtils.masterStormConfKey(topoId);
  WithAcl<Map<String, Object>> cached = confs.get(topoId);
  if (cached == null) {
    //We need to read a new one
    Map<String, Object> topoConf = Utils.fromCompressedJsonConf(store.readBlob(key, who));
    ReadableBlobMeta meta = store.getBlobMeta(key, who);
    cached = new WithAcl<>(meta.get_settable().get_acl(), topoConf);
    WithAcl<Map<String, Object>> previous = confs.putIfAbsent(topoId, cached);
    if (previous != null) {
      cached = previous;
    }
  } else {
    //Check if the user is allowed to read this
    aclHandler.hasPermissions(cached.acl, READ, who, key);
  }
  return cached.data;
}

代码示例来源:origin: apache/storm

try {
  String blobKey = topoId + "-stormconf.ser";
  Map<String, Object> topoConf = Utils.fromCompressedJsonConf(bs.readBlob(blobKey, nimbusSubject));
  String payload = (String) topoConf.get(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD);
  try {

代码示例来源:origin: org.apache.storm/storm-core

public static Map<String, Object> readSupervisorStormConfGivenPath(Map<String, Object> conf, String stormConfPath) throws IOException {
  Map<String, Object> ret = new HashMap<>(conf);
  ret.putAll(Utils.fromCompressedJsonConf(FileUtils.readFileToByteArray(new File(stormConfPath))));
  return ret;
}

代码示例来源:origin: org.apache.storm/storm-core

try {
  String blobKey = topoId + "-stormconf.ser";
  Map<String, Object> topoConf = Utils.fromCompressedJsonConf(bs.readBlob(blobKey, nimbusSubject));
  String payload = (String) topoConf.get(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD);
  try {

相关文章

Utils类方法