@Test public void shouldSetTickTupleFrequencyInComponentConfigurationToNonZeroValue() { RollingCountBolt bolt = new RollingCountBolt(); Map<String, Object> componentConfig = bolt.getComponentConfiguration(); assertThat(componentConfig).containsKey(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS); Integer emitFrequencyInSeconds = (Integer) componentConfig.get(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS); assertThat(emitFrequencyInSeconds).isGreaterThan(0); }
@Override public Map<String, Object> getComponentConfiguration() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds); return conf; }
RollingCountBolt extends BaseRichBolt { @Override public Map<String, Object> getComponentConfiguration() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds); return conf; } }
RollingCountBolt extends BaseRichBolt { @Override public Map<String, Object> getComponentConfiguration() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds); return conf; } RollingCountBolt();  RollingCountBolt(int windowLengthInSeconds, int emitFrequencyInSeconds); }
RollingCountBolt extends BaseRichBolt { @Override public Map<String, Object> getComponentConfiguration() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds); return conf; } RollingCountBolt();  RollingCountBolt(int windowLengthInSeconds, int emitFrequencyInSeconds); @SuppressWarnings("rawtypes") @Override void prepare(Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration(); }
RollingCountBolt extends BaseRichBolt { @Override public Map<String, Object> getComponentConfiguration() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds); return conf; } RollingCountBolt();  RollingCountBolt(int windowLengthInSeconds, int emitFrequencyInSeconds); @SuppressWarnings("rawtypes") @Override void prepare(Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration();  }