当前位置: 首页>>代码示例>>Java>>正文


Java WorkerData.getPort方法代码示例

本文整理汇总了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>();
    }
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:17,代码来源:WorkerHeartbeatRunable.java

示例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);
	}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:16,代码来源:WorkerHeartbeatRunable.java

示例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.");
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:32,代码来源:JStormMetricsReporter.java

示例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<>();
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:15,代码来源:WorkerHeartbeatRunable.java

示例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.");
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:44,代码来源:JStormMetricsReporter.java


注:本文中的com.alibaba.jstorm.daemon.worker.WorkerData.getPort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。