private static void doStormTranslation(Config heronConfig) {
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS)) {
      heronConfig.put(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS,
          heronConfig.get(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS).toString());
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_WORKERS)) {
      Integer nWorkers = Utils.getInt(heronConfig.get(org.apache.storm.Config.TOPOLOGY_WORKERS));
      org.apache.heron.api.Config.setNumStmgrs(heronConfig, nWorkers);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS)) {
      Integer nSecs =
          Utils.getInt(heronConfig.get(org.apache.storm.Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS));
      org.apache.heron.api.Config.setMessageTimeoutSecs(heronConfig, nSecs);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_MAX_SPOUT_PENDING)) {
      Integer nPending =
          Utils.getInt(
              heronConfig.get(org.apache.storm.Config.TOPOLOGY_MAX_SPOUT_PENDING).toString());
      org.apache.heron.api.Config.setMaxSpoutPending(heronConfig, nPending);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS)) {
      Integer tSecs =
          Utils.getInt(
              heronConfig.get(org.apache.storm.Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS).toString());
      org.apache.heron.api.Config.setTickTupleFrequency(heronConfig, tSecs);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_DEBUG)) {
      Boolean dBg =
          Boolean.parseBoolean(heronConfig.get(org.apache.storm.Config.TOPOLOGY_DEBUG).toString());
      org.apache.heron.api.Config.setDebug(heronConfig, dBg);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_ENVIRONMENT)) {
      org.apache.heron.api.Config.setEnvironment(heronConfig,
          (Map) heronConfig.get(org.apache.storm.Config.TOPOLOGY_ENVIRONMENT));
    }
  }
private static void doStormTranslation ( Config heronConfig ) { if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS ) ) { heronConfig . put ( org . apache . storm . Config . TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS , heronConfig . get ( org . apache . storm . Config . TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS ) . toString ( ) ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_WORKERS ) ) { Integer nWorkers = Utils . getInt ( heronConfig . get ( org . apache . storm . Config . TOPOLOGY_WORKERS ) ) ; org . apache . heron . api . Config . setNumStmgrs ( heronConfig , nWorkers ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_MESSAGE_TIMEOUT_SECS ) ) { Integer nSecs = Utils . getInt ( heronConfig . get ( org . apache . storm . Config . TOPOLOGY_MESSAGE_TIMEOUT_SECS ) ) ; org . apache . heron . api . Config . setMessageTimeoutSecs ( heronConfig , nSecs ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_MAX_SPOUT_PENDING ) ) { Integer nPending = Utils . getInt ( heronConfig . get ( org . apache . storm . Config . TOPOLOGY_MAX_SPOUT_PENDING ) . toString ( ) ) ; org . apache . heron . api . Config . setMaxSpoutPending ( heronConfig , nPending ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_TICK_TUPLE_FREQ_SECS ) ) { Integer tSecs = Utils . getInt ( heronConfig . get ( org . apache . storm . Config . TOPOLOGY_TICK_TUPLE_FREQ_SECS ) . toString ( ) ) ; org . apache . heron . api . Config . setTickTupleFrequency ( heronConfig , tSecs ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_DEBUG ) ) { Boolean dBg = Boolean . parseBoolean ( heronConfig . get ( org . apache . storm . Config . TOPOLOGY_DEBUG ) . toString ( ) ) ; org . apache . heron . api . Config . setDebug ( heronConfig , dBg ) ; } if ( heronConfig . containsKey ( org . apache . storm . Config . TOPOLOGY_ENVIRONMENT ) ) { org . apache . heron . api . Config . setEnvironment ( heronConfig , ( Map ) heronConfig . get ( org . apache . storm . Config . TOPOLOGY_ENVIRONMENT ) ) ; } }
Translate storm config into heron config. This funciton is used by both topology
and component level config translations. Therefore NO config should be generated
when a key does NOT exist if the key is for both topology and component.
Otherwise the component config might overwrite the topolgy config with a wrong value.
@param heron the heron config object to receive the results.