本文整理汇总了Java中com.alibaba.jstorm.daemon.worker.WorkerData.getPort方法的典型用法代码示例。如果您正苦于以下问题:Java WorkerData.getPort方法的具体用法?Java WorkerData.getPort怎么用?Java WorkerData.getPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.jstorm.daemon.worker.WorkerData
的用法示例。
在下文中一共展示了WorkerData.getPort方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getStormConf();
this.worker_id = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.task_ids = new CopyOnWriteArraySet<Integer>(workerData.getTaskids());
this.shutdown = workerData.getShutdown();
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequence = JStormUtils.parseInt(conf.get(key), 10);
this.workerStates = new HashMap<String, LocalState>();
}
示例2: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getConf();
this.worker_id = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.task_ids = new CopyOnWriteArraySet<Integer>(
workerData.getTaskids());
this.active = workerData.getActive();
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequence = JStormUtils.parseInt(conf.get(key), 10);
}
示例3: JStormMetricsReporter
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public JStormMetricsReporter(Object role) {
LOG.info("starting jstorm metrics reporter");
if (role instanceof WorkerData) {
WorkerData workerData = (WorkerData) role;
this.conf = workerData.getStormConf();
this.topologyId = (String) conf.get(Config.TOPOLOGY_ID);
this.port = workerData.getPort();
this.isInWorker = true;
} else if (role instanceof NimbusData) {
NimbusData nimbusData = (NimbusData) role;
this.conf = nimbusData.getConf();
this.topologyId = JStormMetrics.NIMBUS_METRIC_KEY;
}
this.host = JStormMetrics.getHost();
this.enableMetrics = JStormMetrics.isEnabled();
if (!enableMetrics) {
LOG.warn("***** topology metrics is disabled! *****");
} else {
LOG.info("topology metrics is enabled.");
}
this.checkMetaThreadCycle = 30;
// flush metric snapshots when time is aligned, check every sec.
this.flushMetricThreadCycle = 1;
LOG.info("check meta thread freq:{}, flush metrics thread freq:{}", checkMetaThreadCycle, flushMetricThreadCycle);
this.localMode = StormConfig.local_mode(conf);
this.clusterName = ConfigExtension.getClusterName(conf);
LOG.info("done.");
}
示例4: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getStormConf();
this.workerId = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.taskIds = new CopyOnWriteArraySet<>(workerData.getTaskIds());
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequency = JStormUtils.parseInt(conf.get(key), 10);
this.workerStates = new HashMap<>();
}
示例5: JStormMetricsReporter
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public JStormMetricsReporter(Object role) {
LOG.info("starting jstorm metrics reporter in {}", role.getClass().getSimpleName());
if (role instanceof WorkerData) {
WorkerData workerData = (WorkerData) role;
this.conf = workerData.getStormConf();
this.topologyId = (String) conf.get(Config.TOPOLOGY_ID);
this.port = workerData.getPort();
this.inTopology = true;
} else if (role instanceof NimbusData) {
NimbusData nimbusData = (NimbusData) role;
this.conf = nimbusData.getConf();
this.topologyId = JStormMetrics.NIMBUS_METRIC_KEY;
} else if (role instanceof SupervisorManger) {
SupervisorManger supervisor = (SupervisorManger) role;
this.conf = supervisor.getConf();
this.topologyId = JStormMetrics.SUPERVISOR_METRIC_KEY;
JStormMetrics.setTopologyId(this.topologyId);
}
// update metrics config
refresh(conf);
this.metricsRegister = new MetricsRegister(conf, topologyId);
this.host = JStormMetrics.getHost();
if (!JStormMetrics.enabled) {
LOG.warn("***** topology metrics is disabled! *****");
} else {
LOG.info("topology metrics is enabled.");
}
this.checkMetaThreadCycle = 20;
// flush metric snapshots when time is aligned, check every sec.
this.flushMetricThreadCycle = 1;
LOG.info("check meta thread freq: {} sec, flush metrics thread freq: {} sec",
checkMetaThreadCycle, flushMetricThreadCycle);
this.localMode = StormConfig.local_mode(conf);
this.clusterName = ConfigExtension.getClusterName(conf);
RefreshableComponents.registerRefreshable(this);
LOG.info("done.");
}