コード例 #1
0
  public int getDelaySeconds(Object[] args) {
    if (oldStatus != null && oldStatus.getDelaySecs() > 0) {
      return oldStatus.getDelaySecs();
    }

    Integer delaySecs = DelayStatusTransitionCallback.DEFAULT_DELAY_SECONDS;
    if (args == null || args.length == 0 || args[0] == null) {
      Map<?, ?> map = null;
      try {

        map = StormConfig.read_nimbus_topology_conf(data.getConf(), topologyid);
        delaySecs =
            JStormUtils.parseInt(
                map.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS), DEFAULT_DELAY_SECONDS);
      } catch (Exception e) {
        LOG.info("Failed to get topology configuration " + topologyid);
      }

    } else {
      delaySecs = JStormUtils.parseInt(args[0]);
    }

    if (delaySecs == null || delaySecs <= 0) {
      delaySecs = DelayStatusTransitionCallback.DEFAULT_DELAY_SECONDS;
    }

    return delaySecs;
  }