@Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.setMaxTaskParallelism(1); return conf; }
/** * Returns a new NestableFieldValidator for a List of the given Class. * * @param cls the Class of elements composing the list * @param nullAllowed whether or not a value of null is valid * @return a NestableFieldValidator for a list of the given class */ public static NestableFieldValidator listFv(Class cls, boolean nullAllowed) { return listFv(fv(cls, false), nullAllowed); }
@Override public Map<String, Object> getComponentConfiguration() { Config ret = new Config(); ret.setMaxTaskParallelism(1); ret.registerSerialization(TransactionAttempt.class); return ret; }
public static void main(String[] args) throws Exception { LocalCluster localCluster = null; try { localCluster = new LocalCluster(); } finally { if (localCluster != null) { localCluster.shutdown(); } } }
@Override public Map<String, Object> getComponentConfiguration() { Config conf = new Config(); conf.registerSerialization(MemoryTransactionalSpoutMeta.class); return conf; }
public static synchronized LocalCluster getInstance() { if (instance == null) instance = new LocalCluster(); return instance; }
/** * Submits a topology to run on the cluster with a progress bar. A topology runs forever or until explicitly killed. * * @param name the name of the storm. * @param stormConf the topology-specific configuration. See {@link Config}. * @param topology the processing to execute. * @throws AlreadyAliveException if a topology with this name is already running * @throws InvalidTopologyException if an invalid topology was submitted */ public static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException { submitTopologyWithProgressBar(name, stormConf, topology, null); }
public LocalCluster() { setLogger(); setEnv(); this.state = LocalUtils.prepareLocalCluster(); if (this.state == null) throw new RuntimeException("prepareLocalCluster error"); }
/** * Returns a new NestableFieldValidator for a Map of key to val. * * @param key the Class of keys in the map * @param val the Class of values in the map * @param nullAllowed whether or not a value of null is valid * @return a NestableFieldValidator for a Map of key to val */ public static NestableFieldValidator mapFv(Class key, Class val, boolean nullAllowed) { return mapFv(fv(key, false), fv(val, false), nullAllowed); }
@Override public void validateField(String name, Object o) throws IllegalArgumentException { if (o == null || o instanceof String) { // A null value or a String value is acceptable return; } this.fv.validateField(name, o); } };
@Override public void submitTopology(String topologyName, Map conf, StormTopology topology) { submitTopologyWithOpts(topologyName, conf, topology, null); }
public GenericOptionsParser(Config conf, Options options, String[] args) throws ParseException { this.conf = conf; parseGeneralOptions(options, conf, args); }
@Override public void validateField(String name, Object field) throws IllegalArgumentException { validateField(null, name, field); }
@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.registerSerialization(MemoryTransactionalSpoutMeta.class); return conf; }
@Override public Map<String, Object> getComponentConfiguration() { Config ret = new Config(); ret.setMaxTaskParallelism(1); return ret; } }
@Override public Map<String, Object> getComponentConfiguration() { Config ret = new Config(); ret.setMaxTaskParallelism(1); return ret; }