org.apache.storm.Config.getOrDefault()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.apache.storm.Config.getOrDefault()方法的一些代码示例,展示了Config.getOrDefault()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getOrDefault()方法的具体详情如下:
包路径:org.apache.storm.Config
类名称:Config
方法名:getOrDefault

Config.getOrDefault介绍

暂无

代码示例

代码示例来源:origin: com.yahoo.bullet/bullet-storm

/**
   * Registers the Sigar CPUMetric and the LoggingMetricsConsumer with a parallelism of 1.
   *
   * @param stormConfig The Storm {@link Config} to add to.
   * @param bulletStormConfig The Bullet {@link BulletStormConfig} to get information from.
   */
  public static void register(Config stormConfig, BulletStormConfig bulletStormConfig) {
    stormConfig.registerMetricsConsumer(LoggingMetricsConsumer.class);
    Map<String, String> metrics = (Map<String, String>) stormConfig.getOrDefault(Config.TOPOLOGY_WORKER_METRICS, new HashMap<>());
    metrics.putAll(METRICS);
    stormConfig.put(Config.TOPOLOGY_WORKER_METRICS, metrics);
  }
}

代码示例来源:origin: bullet-db/bullet-storm

/**
   * Registers the Sigar CPUMetric and the LoggingMetricsConsumer with a parallelism of 1.
   *
   * @param stormConfig The Storm {@link Config} to add to.
   * @param bulletStormConfig The Bullet {@link BulletStormConfig} to get information from.
   */
  public static void register(Config stormConfig, BulletStormConfig bulletStormConfig) {
    stormConfig.registerMetricsConsumer(LoggingMetricsConsumer.class);
    Map<String, String> metrics = (Map<String, String>) stormConfig.getOrDefault(Config.TOPOLOGY_WORKER_METRICS, new HashMap<>());
    metrics.putAll(METRICS);
    stormConfig.put(Config.TOPOLOGY_WORKER_METRICS, metrics);
  }
}

代码示例来源:origin: NationalSecurityAgency/lemongrenade

int workers = (int) getConfig().getOrDefault("topology.workers", 1);
log.info("Setting bolt for "+getAdapterName()+". Workers:"+workers+" Executors:"+executors+" Tasks:"+tasks);

代码示例来源:origin: NationalSecurityAgency/lemongrenade

int workers = (int) getConfig().getOrDefault("topology.workers", 1);
log.info("Setting bolt for "+getAdapterName()+". Workers:"+workers+" Executors:" + executors + " Tasks:" + tasks);
builder.setBolt(LGConstants.LEMONGRENADE_COORDINATOR, new CoordinatorBolt(), executors)

相关文章