本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}
示例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);
}
}
}
示例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());
}