private TopologyDetails readTopologyDetails(String topoId, StormBase base) throws KeyNotFoundException, AuthorizationException, IOException, InvalidTopologyException { assert (base != null); assert (topoId != null); Map<String, Object> topoConf = readTopoConfAsNimbus(topoId, topoCache); StormTopology topo = readStormTopologyAsNimbus(topoId, topoCache); if (!base.is_set_principal()) { fixupBase(base, topoConf); stormClusterState.updateStorm(topoId, base); } Map<List<Integer>, String> rawExecToComponent = computeExecutorToComponent(topoId, base, topoConf, topo); Map<ExecutorDetails, String> executorsToComponent = new HashMap<>(); for (Entry<List<Integer>, String> entry : rawExecToComponent.entrySet()) { List<Integer> execs = entry.getKey(); ExecutorDetails execDetails = new ExecutorDetails(execs.get(0), execs.get(1)); executorsToComponent.put(execDetails, entry.getValue()); } return new TopologyDetails(topoId, topoConf, topo, base.get_num_workers(), executorsToComponent, base.get_launch_time_secs(), base.get_owner()); }
public static TopologyDetails getTopology(String name, Map<String, Object> config, int numSpout, int numBolt, int spoutParallelism, int boltParallelism, int launchTime, boolean blacklistEnable) { Config conf = new Config(); conf.putAll(config); conf.put(Config.TOPOLOGY_NAME, name); StormTopology topology = buildTopology(numSpout, numBolt, spoutParallelism, boltParallelism); TopologyDetails topo = new TopologyDetails(name + "-" + launchTime, conf, topology, 3, genExecsAndComps(topology, spoutParallelism, boltParallelism), launchTime, "user"); return topo; }
config.putAll(defaultTopologyConf); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config, stormTopology1, 2, executorMap1, 0, "user");
public static TopologyDetails topoToTopologyDetails(String name, Map<String, Object> config, StormTopology topology, int launchTime, int priority, String user, double maxHeapSize) { Config conf = new Config(); conf.putAll(config); conf.put(Config.TOPOLOGY_PRIORITY, priority); conf.put(Config.TOPOLOGY_NAME, name); conf.put(Config.TOPOLOGY_SUBMITTER_USER, user); conf.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, maxHeapSize); TopologyDetails topo = new TopologyDetails(name + "-" + launchTime, conf, topology, 0, genExecsAndComps(topology), launchTime, user); return topo; }
conf.put(Config.TOPOLOGY_SUBMITTER_USER, "user"); TopologyDetails topo = new TopologyDetails("testTopology-id", conf, stormToplogy, 0, genExecsAndComps(stormToplogy), currentTime, "user");
conf.put(Config.TOPOLOGY_SUBMITTER_USER, "user"); TopologyDetails topo = new TopologyDetails("testTopology-id", conf, stormToplogy, 0, genExecsAndComps(stormToplogy), CURRENT_TIME, "user");
config1.putAll(topologyConf); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config1, stormTopology1, 1, executorMap1, 0, "user"); config2.putAll(topologyConf); Map<ExecutorDetails, String> executorMap2 = genExecsAndComps(stormTopology2); TopologyDetails topology2 = new TopologyDetails("topology2", config2, stormTopology2, 1, executorMap2, 0, "user"); config3.putAll(topologyConf); Map<ExecutorDetails, String> executorMap3 = genExecsAndComps(stormTopology3); TopologyDetails topology3 = new TopologyDetails("topology3", config2, stormTopology3, 1, executorMap3, 0, "user"); config4.putAll(topologyConf); Map<ExecutorDetails, String> executorMap4 = genExecsAndComps(stormTopology4); TopologyDetails topology4 = new TopologyDetails("topology4", config4, stormTopology4, 1, executorMap4, 0, "user"); config5.putAll(topologyConf); Map<ExecutorDetails, String> executorMap5 = genExecsAndComps(stormTopology5); TopologyDetails topology5 = new TopologyDetails("topology5", config5, stormTopology5, 1, executorMap5, 0, "user");
conf.put(Config.TOPOLOGY_NAME, "testTopology"); conf.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, 2000); TopologyDetails topo = new TopologyDetails("testTopology-id", conf, stormToplogy, 0, genExecsAndComps(stormToplogy), currentTime, "user");
config1.putAll(defaultTopologyConf); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config1, stormTopology1, 3, executorMap1, 0, "user"); TopologyDetails topology2 = new TopologyDetails("topology2", config2, stormTopology2, 2, executorMap2, 0, "user");
config.putAll(defaultTopologyConf); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config, stormTopology1, 0, executorMap1, 0, "user");
config1.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, 128.0); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config1, stormTopology1, 1, executorMap1, 0, "user"); ResourceAwareScheduler rs = new ResourceAwareScheduler(); Topologies topologies = new Topologies(topology1); config2.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, 128.0); Map<ExecutorDetails, String> executorMap2 = genExecsAndComps(stormTopology2); TopologyDetails topology2 = new TopologyDetails("topology2", config2, stormTopology2, 1, executorMap2, 0, "user"); topologies = new Topologies(topology2); cluster = new Cluster(iNimbus, new ResourceMetrics(new StormMetricsRegistry()), supMap, new HashMap<>(), topologies, config2);
config.putAll(defaultTopologyConf); Map<ExecutorDetails, String> executorMap1 = genExecsAndComps(stormTopology1); TopologyDetails topology1 = new TopologyDetails("topology1", config, stormTopology1, 0, executorMap1, 0, "user"); StormTopology stormTopology2 = builder2.createTopology(); Map<ExecutorDetails, String> executorMap2 = genExecsAndComps(stormTopology2); TopologyDetails topology2 = new TopologyDetails("topology2", config, stormTopology2, 0, executorMap2, 0, "user");
conf.put(Config.TOPOLOGY_NAME, "testTopology"); conf.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, 2000); TopologyDetails topo = new TopologyDetails("testTopology-id", conf, stormToplogy, 0, genExecsAndComps(stormToplogy), CURRENT_TIME, "user");
TopologyDetails topo = new TopologyDetails("topo-1", config, stormTopology, 0, genExecsAndComps(stormTopology), 0, "jerry");