storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Spico Florin <>
Subject initState method not invoked in Storm 1.0
Date Fri, 15 Apr 2016 08:33:18 GMT
  I'm running a topology in LocalCluster that has a stasteful Bolt. Wile
debugging, I have observed that the initState method is not invoked at all.
The documentation said:
"The initState method is invoked by the framework during the bolt
initialization with the previously saved state of the bolt. This is invoked
after prepare but before the bolt starts processing any tuples".

Due to this, the state field remains null and I get NPE when I populate it
with state .put
Any idea why the initState is not invoked?

Here is my code:

public class TimeSeriesStatefulBolt extends
BaseStatefulBolt<KeyValueState<Long, Map<String, Float>>> {

private KeyValueState<Long, Map<String, Float>> state;
public void initState(KeyValueState<Long, Map<String, Float>> state) {
this.state = state;

View raw message