code: public static State getState(String namespace, Map stormConf, TopologyContext context) {
          State state;
          try {
              String provider;
              if (stormConf.containsKey(Config.TOPOLOGY_STATE_PROVIDER)) {
                  provider = (String) stormConf.get(Config.TOPOLOGY_STATE_PROVIDER);
              } else {
                  provider = DEFAULT_PROVIDER;
              }
              Class<?> klazz = Class.forName(provider);
              Object object = klazz.newInstance();
              if (object instanceof StateProvider) {
                  state = ((StateProvider) object).newState(namespace, stormConf, context);
              } else {
                  String msg = "Invalid state provider '" + provider +
                          "'. Should implement org.apache.storm.state.StateProvider";
                  LOG.error(msg);
                  throw new RuntimeException(msg);
              }
          } catch (Exception ex) {
              LOG.error("Got exception while loading the state provider", ex);
              throw new RuntimeException(ex);
          }
          return state;
      }
docs: Returns a new state instance using the {@link Config#TOPOLOGY_STATE_PROVIDER} or a
  {@link InMemoryKeyValueState} if no provider is configured.
  
  @param namespace the state namespace
  @param stormConf the storm conf
  @param context   the topology context
  @return the state instance