当前位置: 首页>>代码示例>>Java>>正文


Java ComponentCommon.get_json_conf方法代码示例

本文整理汇总了Java中backtype.storm.generated.ComponentCommon.get_json_conf方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentCommon.get_json_conf方法的具体用法?Java ComponentCommon.get_json_conf怎么用?Java ComponentCommon.get_json_conf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backtype.storm.generated.ComponentCommon的用法示例。


在下文中一共展示了ComponentCommon.get_json_conf方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: maxTopologyMessageTimeout

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public int maxTopologyMessageTimeout() {
	Integer max = Utils.getInt(_stormConf
			.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS));
	for (String spout : getRawTopology().get_spouts().keySet()) {
		ComponentCommon common = getComponentCommon(spout);
		String jsonConf = common.get_json_conf();
		if (jsonConf != null) {
			Map conf = (Map) Utils.from_json(jsonConf);
			Object comp = conf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS);
			if (comp != null) {
				max = Math.max(Utils.getInt(comp), max);
			}
		}
	}
	return max;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:17,代码来源:GeneralTopologyContext.java

示例2: componentParalism

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public static Integer componentParalism(Map stormConf,
		ComponentCommon common) {
	Map mergeMap = new HashMap();
	mergeMap.putAll(stormConf);

	String jsonConfString = common.get_json_conf();
	if (jsonConfString != null) {
		Map componentMap = (Map) JStormUtils.from_json(jsonConfString);
		mergeMap.putAll(componentMap);
	}

	Integer taskNum = common.get_parallelism_hint();
	if (taskNum == null) {
		taskNum = Integer.valueOf(1);
	}

	// don't get taskNum from component configuraiton
	// skip .setTaskNum
	// Integer taskNum = null;
	// Object taskNumObject = mergeMap.get(Config.TOPOLOGY_TASKS);
	// if (taskNumObject != null) {
	// taskNum = JStormUtils.parseInt(taskNumObject);
	// } else {
	// taskNum = common.get_parallelism_hint();
	// if (taskNum == null) {
	// taskNum = Integer.valueOf(1);
	// }
	// }

	Object maxTaskParalismObject = mergeMap
			.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
	if (maxTaskParalismObject == null) {
		return taskNum;
	} else {
		int maxTaskParalism = JStormUtils.parseInt(maxTaskParalismObject);

		return Math.min(maxTaskParalism, taskNum);
	}

}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:41,代码来源:NimbusUtils.java

示例3: componentParalism

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public static Integer componentParalism(Map stormConf, ComponentCommon common) {
    Map mergeMap = new HashMap();
    mergeMap.putAll(stormConf);

    String jsonConfString = common.get_json_conf();
    if (jsonConfString != null) {
        Map componentMap = (Map) JStormUtils.from_json(jsonConfString);
        mergeMap.putAll(componentMap);
    }

    Integer taskNum = common.get_parallelism_hint();
    if (taskNum == null) {
        taskNum = Integer.valueOf(1);
    }

    // don't get taskNum from component configuraiton
    // skip .setTaskNum
    // Integer taskNum = null;
    // Object taskNumObject = mergeMap.get(Config.TOPOLOGY_TASKS);
    // if (taskNumObject != null) {
    // taskNum = JStormUtils.parseInt(taskNumObject);
    // } else {
    // taskNum = common.get_parallelism_hint();
    // if (taskNum == null) {
    // taskNum = Integer.valueOf(1);
    // }
    // }

    Object maxTaskParalismObject = mergeMap.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
    if (maxTaskParalismObject == null) {
        return taskNum;
    } else {
        int maxTaskParalism = JStormUtils.parseInt(maxTaskParalismObject);

        return Math.min(maxTaskParalism, taskNum);
    }

}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:39,代码来源:NimbusUtils.java

示例4: maxTopologyMessageTimeout

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public int maxTopologyMessageTimeout() {
    Integer max = Utils.getInt(_stormConf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS));
    for (String spout : getRawTopology().get_spouts().keySet()) {
        ComponentCommon common = getComponentCommon(spout);
        String jsonConf = common.get_json_conf();
        if (jsonConf != null) {
            Map conf = (Map) Utils.from_json(jsonConf);
            Object comp = conf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS);
            if (comp != null) {
                max = Math.max(Utils.getInt(comp), max);
            }
        }
    }
    return max;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:16,代码来源:GeneralTopologyContext.java

示例5: maxTopologyMessageTimeout

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public int maxTopologyMessageTimeout() {
    Integer max = Utils.getInt(_stormConf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS));
    for(String spout: getRawTopology().get_spouts().keySet()) {
        ComponentCommon common = getComponentCommon(spout);
        String jsonConf = common.get_json_conf();
        if(jsonConf!=null) {
            Map conf = (Map) JSONValue.parse(jsonConf);
            Object comp = conf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS);
            if(comp!=null) {
                max = Math.max(Utils.getInt(comp), max);
            }
        }
    }
    return max;
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:16,代码来源:GeneralTopologyContext.java

示例6: componentParalism

import backtype.storm.generated.ComponentCommon; //导入方法依赖的package包/类
public static Integer componentParalism(Map stormConf, ComponentCommon common) {
    Map mergeMap = new HashMap();
    mergeMap.putAll(stormConf);

    String jsonConfString = common.get_json_conf();
    if (jsonConfString != null) {
        Map componentMap = (Map) JStormUtils.from_json(jsonConfString);
        mergeMap.putAll(componentMap);
    }

    Integer taskNum = common.get_parallelism_hint();

    // don't get taskNum from component configuraiton
    // skip .setTaskNum
    // Integer taskNum = null;
    // Object taskNumObject = mergeMap.get(Config.TOPOLOGY_TASKS);
    // if (taskNumObject != null) {
    // taskNum = JStormUtils.parseInt(taskNumObject);
    // } else {
    // taskNum = common.get_parallelism_hint();
    // if (taskNum == null) {
    // taskNum = Integer.valueOf(1);
    // }
    // }

    Object maxTaskParalismObject = mergeMap.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
    if (maxTaskParalismObject == null) {
        return taskNum;
    } else {
        int maxTaskParalism = JStormUtils.parseInt(maxTaskParalismObject);

        return Math.min(maxTaskParalism, taskNum);
    }

}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:36,代码来源:NimbusUtils.java


注:本文中的backtype.storm.generated.ComponentCommon.get_json_conf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。