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


Java NotAliveException类代码示例

本文整理汇总了Java中backtype.storm.generated.NotAliveException的典型用法代码示例。如果您正苦于以下问题:Java NotAliveException类的具体用法?Java NotAliveException怎么用?Java NotAliveException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NotAliveException类属于backtype.storm.generated包,在下文中一共展示了NotAliveException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTopologyTPS

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
protected long getTopologyTPS(TopologySummary topology, Client client) throws NotAliveException, TException{
    long topologyTps = 0l;
    String topologyId = topology.get_id();
    if(topologyId.startsWith("ClusterMonitor")){
        return topologyTps;
    }
    TopologyInfo topologyInfo = client.getTopologyInfo(topologyId);
    if(topologyInfo == null){
        return topologyTps;
    }
    List<ExecutorSummary> executorSummaryList = topologyInfo.get_executors();
    for(ExecutorSummary executor : executorSummaryList){
        topologyTps += getComponentTPS(executor);
    }
    LOGGER.info("topology = " + topology.get_name() + ", tps = " + topologyTps);
    return topologyTps;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:18,代码来源:ClusterInfoBolt.java

示例2: getTopology

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
/**
 * get StormTopology throw deserialize local files
 * 
 * @param id
 *            String: topology id
 * @return StormTopology
 */
@Override
public StormTopology getTopology(String id) throws NotAliveException,
		TException {
	StormTopology topology = null;
	try {
		StormTopology stormtopology = StormConfig
				.read_nimbus_topology_code(conf, id);
		if (stormtopology == null) {
			throw new TException("topology:" + id + "is null");
		}

		Map<Object, Object> topologyConf = StormConfig
				.read_nimbus_topology_conf(conf, id);

		topology = Common.system_topology(topologyConf, stormtopology);
	} catch (Exception e) {
		LOG.error("Failed to get topology " + id + ",", e);
		throw new TException("Failed to get system_topology");
	}
	return topology;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:29,代码来源:ServiceHandler.java

示例3: metricMonitor

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
@Override
public void metricMonitor(String topologyName, MonitorOptions options) throws NotAliveException, 
        TException {
	boolean isEnable = options.is_isEnable();
	StormClusterState clusterState = data.getStormClusterState();
	
	try {
	    String topologyId = Cluster.get_topology_id(clusterState, topologyName);
	    if (null != topologyId) {
		    NimbusUtils.updateMetricMonitorStatus(clusterState, topologyId, isEnable);
	    } else {
		    throw new NotAliveException("Failed to update metricsMonitor status as " + topologyName + " is not alive");
	    }
	} catch(Exception e) {
		String errMsg = "Failed to update metricsMonitor " + topologyName;
		LOG.error(errMsg, e);
		throw new TException(e);
	}
	
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:21,代码来源:ServiceHandler.java

示例4: BoltPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public BoltPage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}

	if (ctx.getExternalContext().getRequestParameterMap()
			.get("componentid") != null) {
		componentid = ctx.getExternalContext()
				.getRequestParameterMap().get("componentid");
	}

	window = UIUtils.getWindow(ctx);

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	init();
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:27,代码来源:BoltPage.java

示例5: SpoutPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public SpoutPage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}

	if (ctx.getExternalContext().getRequestParameterMap()
			.get("componentid") != null) {
		componentid = ctx.getExternalContext()
				.getRequestParameterMap().get("componentid");
	}

	window = UIUtils.getWindow(ctx);

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	init();
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:27,代码来源:SpoutPage.java

示例6: Taskpage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public Taskpage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}
	if (ctx.getExternalContext().getRequestParameterMap().get("taskid") != null) {
		taskid = ctx.getExternalContext().getRequestParameterMap()
				.get("taskid");
	}

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	window = UIUtils.getWindow(ctx);
	init();
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:23,代码来源:Taskpage.java

示例7: TopologyPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public TopologyPage() throws Exception {

		FacesContext ctx = FacesContext.getCurrentInstance();
		if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
			clusterName = ctx.getExternalContext()
					.getRequestParameterMap().get("clusterName");
		}
		if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
			topologyid = ctx.getExternalContext()
					.getRequestParameterMap().get("topologyid");
		}
		LOG.debug("Query clusterName=" + clusterName + ", topology=" + topologyid);

		window = UIUtils.getWindow(ctx);
		LOG.info("Window:" + window);

		if (topologyid == null) {

			LOG.error("Not set topologyid");
			throw new NotAliveException("Input topologyId is null ");

		}

		init();
	}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:26,代码来源:TopologyPage.java

示例8: getTopologyConf

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
/**
 * get topology configuration
 * 
 * @param id
 *            String: topology id
 * @return String
 */
@Override
public String getTopologyConf(String id) throws NotAliveException,
		TException {
	String rtn;
	try {
		Map<Object, Object> topologyConf = StormConfig
				.read_nimbus_topology_conf(conf, id);
		rtn = JStormUtils.to_json(topologyConf);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		LOG.info("Failed to get configuration of " + id, e);
		throw new TException(e);
	}
	return rtn;
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:23,代码来源:ServiceHandler.java

示例9: getTopology

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
/**
 * get StormTopology throw deserialize local files
 * 
 * @param id
 *            String: topology id
 * @return StormTopology
 */
@Override
public StormTopology getTopology(String id) throws NotAliveException,
		TException {
	StormTopology topology = null;
	try {
		StormTopology stormtopology = StormConfig
				.read_nimbus_topology_code(conf, id);
		if (stormtopology == null) {
			throw new TException("topology:" + id + "is null");
		}

		Map<Object, Object> topologyConf = (Map<Object, Object>) StormConfig
				.read_nimbus_topology_conf(conf, id);

		topology = Common.system_topology(topologyConf, stormtopology);
	} catch (Exception e) {
		LOG.error("Failed to get topology " + id + ",", e);
		throw new TException("Failed to get system_topology");
	}
	return topology;
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:29,代码来源:ServiceHandler.java

示例10: BoltPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public BoltPage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}

	if (ctx.getExternalContext().getRequestParameterMap()
			.get("componentid") != null) {
		componentid = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("componentid");
	}

	window = UIUtils.getWindow(ctx);

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	init();
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:27,代码来源:BoltPage.java

示例11: SpoutPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public SpoutPage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}

	if (ctx.getExternalContext().getRequestParameterMap()
			.get("componentid") != null) {
		componentid = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("componentid");
	}

	window = UIUtils.getWindow(ctx);

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	init();
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:27,代码来源:SpoutPage.java

示例12: Taskpage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public Taskpage() throws TException, NotAliveException {
	FacesContext ctx = FacesContext.getCurrentInstance();
	if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
		clusterName = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("clusterName");
	}
	if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
		topologyid = (String) ctx.getExternalContext()
				.getRequestParameterMap().get("topologyid");
	}
	if (ctx.getExternalContext().getRequestParameterMap().get("taskid") != null) {
		taskid = (String) ctx.getExternalContext().getRequestParameterMap()
				.get("taskid");
	}

	if (topologyid == null) {
		throw new NotAliveException("Input topologyId is null ");
	}

	window = UIUtils.getWindow(ctx);
	init();
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:23,代码来源:Taskpage.java

示例13: TopologyPage

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
public TopologyPage() throws Exception {

		FacesContext ctx = FacesContext.getCurrentInstance();
		if (ctx.getExternalContext().getRequestParameterMap().get("clusterName") != null) {
			clusterName = (String) ctx.getExternalContext()
					.getRequestParameterMap().get("clusterName");
		}
		if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
			topologyid = (String) ctx.getExternalContext()
					.getRequestParameterMap().get("topologyid");
		}
		LOG.debug("Query clusterName=" + clusterName + ", topology=" + topologyid);

		window = UIUtils.getWindow(ctx);
		LOG.info("Window:" + window);

		if (topologyid == null) {

			LOG.error("Not set topologyid");
			throw new NotAliveException("Input topologyId is null ");

		}

		init();
	}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:26,代码来源:TopologyPage.java

示例14: getTopologyWorkersToSupervisorIds

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
@Override
public Map<String, Map<String, String>> getTopologyWorkersToSupervisorIds(String topologyName)
        throws NotAliveException, TException {
    StormClusterState stormClusterState = data.getStormClusterState();
    String topologyId = getTopologyId(topologyName);
    Map<String, Map<String, String>> ret = new HashMap<>();
    try {
        Assignment assignment = stormClusterState.assignment_info(topologyId, null);
        Set<ResourceWorkerSlot> workers = assignment.getWorkers();
        for (ResourceWorkerSlot worker : workers) {
            String supervisorId = worker.getNodeId();
            if (!ret.containsKey(worker.getHostname()))
                ret.put(worker.getHostname(), new HashMap<String, String>());
            ret.get(worker.getHostname()).put(String.valueOf(worker.getPort()), supervisorId);
        }
    } catch (Exception ex) {
        LOG.error("Error:", ex);
    }
    return ret;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:21,代码来源:ServiceHandler.java

示例15: getTopologyId

import backtype.storm.generated.NotAliveException; //导入依赖的package包/类
@Override
public String getTopologyId(String topologyName) throws TException {
    StormClusterState stormClusterState = data.getStormClusterState();

    try {
        // get all active topology's StormBase
        String topologyId = Cluster.get_topology_id(stormClusterState, topologyName);
        if (topologyId != null) {
            return topologyId;
        }

    } catch (Exception e) {
        LOG.info("Failed to get getTopologyId " + topologyName, e);
        throw new TException("Failed to get getTopologyId " + topologyName);
    }

    // topologyId == null
    throw new NotAliveException("No topology of " + topologyName);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:20,代码来源:ServiceHandler.java


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