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


Java GeneralTopologyContext.getRawTopology方法代码示例

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


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

示例1: KryoTupleDeserializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public KryoTupleDeserializer(final Map conf,
		final GeneralTopologyContext context) {
	_kryo = new KryoValuesDeserializer(conf);
	_context = context;
	_ids = new SerializationFactory.IdDictionary(context.getRawTopology());
	_kryoInput = new Input(1);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:KryoTupleDeserializer.java

示例2: KryoTupleSerializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public KryoTupleSerializer(final Map conf,
		final GeneralTopologyContext context) {
	_kryo = new KryoValuesSerializer(conf);
	_kryoOut = new Output(2000, 2000000000);
	_ids = new SerializationFactory.IdDictionary(context.getRawTopology());
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:KryoTupleSerializer.java

示例3: KryoTupleDeserializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleDeserializer(final Map conf,
		final GeneralTopologyContext context) {
	_kryo = new KryoValuesDeserializer(conf);
	_context = context;
	_ids = new SerializationFactory.IdDictionary(context.getRawTopology());
	_kryoInput = new Input(1);
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:8,代码来源:KryoTupleDeserializer.java

示例4: KryoTupleDeserializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleDeserializer(final Map conf,
    final GeneralTopologyContext context) {
_kryo = new KryoValuesDeserializer(conf);
_context = context;
_ids = new SerializationFactory.IdDictionary(context.getRawTopology());
_kryoInput = new Input(1);
   }
 
开发者ID:troyding,项目名称:storm-resa,代码行数:8,代码来源:KryoTupleDeserializer.java

示例5: WorkerDeserializeRunnable

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public WorkerDeserializeRunnable(List<TaskShutdownDameon> shutdownTasks,
                                 Map stormConf,
                                 GeneralTopologyContext topologyContext,
                                 int startRunTaskIndex,
                                 int threadIndex) {
    this.shutdownTasks = shutdownTasks;
    this.threadIndex = threadIndex;
    this.startRunTaskIndex = startRunTaskIndex;
    this.deserializer = new KryoTupleDeserializer(stormConf, topologyContext, topologyContext.getRawTopology());
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:11,代码来源:WorkerDeserializeRunnable.java

示例6: WorkerSerializeRunnable

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public WorkerSerializeRunnable(List<TaskShutdownDameon> shutdownTasks, Map stormConf,
                               GeneralTopologyContext topologyContext, int startRunTaskIndex, int threadIndex) {
    this.shutdownTasks = shutdownTasks;
    this.threadIndex = threadIndex;
    this.startRunTaskIndex = startRunTaskIndex;
    this.serializer = new KryoTupleSerializer(stormConf, topologyContext.getRawTopology());
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:8,代码来源:WorkerSerializeRunnable.java

示例7: KryoTupleSerializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleSerializer(final Map conf,
		final GeneralTopologyContext context) {
	_kryo = new KryoValuesSerializer(conf);
	_kryoOut = new Output(2000, 2000000000);
	_ids = new SerializationFactory.IdDictionary(context.getRawTopology());
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:7,代码来源:KryoTupleSerializer.java

示例8: KryoTupleDeserializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleDeserializer(final Map conf, final GeneralTopologyContext context) {
    _kryo = new KryoValuesDeserializer(conf);
    _context = context;
    _ids = new SerializationFactory.IdDictionary(context.getRawTopology());
    _kryoInput = new Input(1);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:7,代码来源:KryoTupleDeserializer.java

示例9: KryoTupleSerializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleSerializer(final Map conf, final GeneralTopologyContext context) {
    _kryo = new KryoValuesSerializer(conf);
    _kryoOut = new Output(2000, 2000000000);
    _ids = new SerializationFactory.IdDictionary(context.getRawTopology());
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:6,代码来源:KryoTupleSerializer.java

示例10: testMakeUsingTopologyHelper

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
@Test
public void testMakeUsingTopologyHelper() throws Exception {

    conf.put(Config.NIMBUS_HOST, "192.168.0.30");
    conf.put(Config.NIMBUS_THRIFT_PORT, 6627);

    conf.put("resa.opt.smd.qos.ms", 1500.0);
    conf.put("resa.opt.win.history.size", 3);

    conf.put("resa.comp.sample.rate", 1.0);

    conf.put(ResaConfig.ALLOWED_EXECUTOR_NUM, 7);

    GeneralTopologyContext gtc = TopologyHelper.getGeneralTopologyContext("ta1wc2Redis", conf);

    if (gtc == null) {
        System.out.println("gtc is null");
        return;
    }

    String host = "192.168.0.30";
    int port = 6379;
    String queue = "ta1wc";
    int maxLen = 500;

    String topoName = "ta1wc2Redis";

    NimbusClient nimbusClient = NimbusClient.getConfiguredClient(conf);
    Nimbus.Client nimbus = nimbusClient.getClient();
    String topoId = TopologyHelper.getTopologyId(nimbus, topoName);

    TopologyInfo topoInfo = nimbus.getTopologyInfo(topoId);

    Map<String, Integer> currAllocation = topoInfo.get_executors().stream().filter(e -> !Utils.isSystemId(e.get_component_id()))
            .collect(Collectors.groupingBy(e -> e.get_component_id(),
                    Collectors.reducing(0, e -> 1, (i1, i2) -> i1 + i2)));

    SimpleGeneralAllocCalculator smdm = new SimpleGeneralAllocCalculator();
    smdm.init(conf, currAllocation, gtc.getRawTopology());

    Map<String, List<ExecutorDetails>> comp2Executors = TopologyHelper.getTopologyExecutors(topoName, conf)
            .entrySet().stream().filter(e -> !Utils.isSystemId(e.getKey()))
            .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

    for (int i = 0; i < 10000; i++) {
        Utils.sleep(30000);

        topoInfo = nimbus.getTopologyInfo(topoId);
        Map<String, Integer> updatedAllocation = topoInfo.get_executors().stream().filter(e -> !Utils.isSystemId(e.get_component_id()))
                .collect(Collectors.groupingBy(e -> e.get_component_id(),
                        Collectors.reducing(0, e -> 1, (i1, i2) -> i1 + i2)));

        AggResultCalculator resultCalculator = new AggResultCalculator(
                RedisDataSource.readData(host, port, queue, maxLen), comp2Executors, gtc.getRawTopology());
        resultCalculator.calCMVStat();

        System.out.println("-------------Report on: " + System.currentTimeMillis() + "------------------------------");
        if (currAllocation.equals(updatedAllocation)) {
            System.out.println(currAllocation + "-->" + smdm.calc(resultCalculator.getResults(), 7));
        } else {
            currAllocation = updatedAllocation;
            smdm.allocationChanged(currAllocation);
            System.out.println("Allocation updated to " + currAllocation);
        }
    }
}
 
开发者ID:ADSC-Resa,项目名称:resa,代码行数:67,代码来源:SimpleGeneralAllocCalculatorTest.java

示例11: KryoTupleSerializer

import backtype.storm.task.GeneralTopologyContext; //导入方法依赖的package包/类
public KryoTupleSerializer(final Map conf,
                           final GeneralTopologyContext context) {
    _kryo = new KryoValuesSerializer(conf);
    _kryoOut = new Output(2000, 2000000000);
    _ids = new SerializationFactory.IdDictionary(context.getRawTopology());
}
 
开发者ID:troyding,项目名称:storm-resa,代码行数:7,代码来源:KryoTupleSerializer.java


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