public static void main(String[] args) throws Exception { StormTopology topology = getStormTopology(); Config conf = new Config(); conf.setDebug(true); String topoName = "test"; if (args.length > 0) { topoName = args[0]; } conf.setNumWorkers(3); StormSubmitter.submitTopologyWithProgressBar(topoName, conf, topology); }
@Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.setMaxTaskParallelism(1); return conf; }
@Override public Map<String, Object> getComponentConfiguration() { Config ret = new Config(); ret.setMaxTaskParallelism(1); ret.registerSerialization(TransactionAttempt.class); return ret; }
public void setStormConf(Map<String, Object> topoConf) { if (topoConf == null) { topoConf = new Config(); } this.topoConf = topoConf; }
/** * Set the max heap size allow per worker for this topology. * * @param size the maximum heap size for a worker. */ public void setTopologyWorkerMaxHeapSize(Number size) { if (size != null) { this.put(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB, size); } }
/** * Builds a new LocalCluster. * * @return the LocalCluster * * @throws Exception on any one of many different errors. This is intended for testing so yes it is ugly and throws Exception... */ public LocalCluster build() throws Exception { return new LocalCluster(this); } }
/** * Get all of the tuples from a given component on the default stream * @param results the results of running a completed topology * @param componentId the id of the component to look at * @return a list of the tuple values. */ public static List<List<Object>> readTuples(Map<String, List<FixedTuple>> results, String componentId) { return readTuples(results, componentId, Utils.DEFAULT_STREAM_ID); }
/** * Turn on simulated time in the cluster. This allows someone to simulate long periods of time for timeouts etc when testing * nimbus/supervisors themselves. NOTE: that this only works for code that uses the {@link org.apache.storm.utils.Time} class for * time management so it will not work in all cases. */ public Builder withSimulatedTime() { return withSimulatedTime(true); }
@Override public void close() throws TException { killTopologyWithOpts(topoName, KILL_NOW); } }
/** * Add another supervisor to the topology. This is intended mostly for internal testing. * * @param ports the number of ports/slots the supervisor should have */ public Supervisor addSupervisor(Number ports) throws Exception { return addSupervisor(ports, null, null); }
/** * Simulated time wait for a cluster. This is intended for internal testing */ public static void advanceClusterTime(ILocalCluster cluster, Integer secs) throws InterruptedException { advanceClusterTime(cluster, secs, 1); }
public static BoltDetails prepareBoltDetails(Map<GlobalStreamId, Grouping> inputs, Object bolt, Integer parallelismHint, Map<String, Object> conf) { BoltDetails details = new BoltDetails(bolt, conf, parallelismHint, inputs); return details; }
@Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.setMaxTaskParallelism(1); return conf; }
/** * Sets the maximum number of states that will be searched in the constraint solver strategy. * * @param numStates maximum number of stats to search. */ public void setTopologyConstraintsMaxStateSearch(int numStates) { this.put(Config.TOPOLOGY_RAS_CONSTRAINT_MAX_STATE_SEARCH, numStates); }
/** * Get the component configuration. * @return the component configuration */ @Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.setMaxTaskParallelism(1); return conf; } }
@Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.setMaxTaskParallelism(1); return conf; }