本文整理了Java中org.apache.storm.Config.getOrDefault()
方法的一些代码示例,展示了Config.getOrDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getOrDefault()
方法的具体详情如下:
包路径:org.apache.storm.Config
类名称: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)
内容来源于网络,如有侵权,请联系作者删除!