public NotAliveException deepCopy() { return new NotAliveException(this); }
public NotAliveException deepCopy() { return new NotAliveException(this); }
/** * Performs a deep copy on <i>other</i>. */ public killTopology_result(killTopology_result other) { if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * Performs a deep copy on <i>other</i>. */ public activate_result(activate_result other) { if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * Performs a deep copy on <i>other</i>. */ public deactivate_result(deactivate_result other) { if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * Performs a deep copy on <i>other</i>. */ public killTopologyWithOpts_result(killTopologyWithOpts_result other) { if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * Performs a deep copy on <i>other</i>. */ public rebalance_result(rebalance_result other) { if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
@Override public void grayUpgrade(String topologyName, String component, List<String> workers, int workerNum) throws TException { String topologyId = getTopologyId(topologyName); if (topologyId == null) { throw new NotAliveException(topologyName); } Set<String> workerSet = (workers == null) ? Sets.<String>newHashSet() : Sets.<String>newHashSet(workers); try { grayUpgrade(topologyId, null, null, Maps.newHashMap(), component, workerSet, workerNum); } catch (Exception ex) { LOG.error("Failed to upgrade", ex); throw new TException(ex); } }
@Override public StormTopology getUserTopology(String id) throws TException { try { StormTopology stormtopology = StormConfig.read_nimbus_topology_code(id, data.getBlobStore()); if (stormtopology == null) { throw new NotAliveException("No topology of " + id); } return stormtopology; } catch (Exception e) { LOG.error("Failed to get topology " + id + ",", e); throw new TException("Failed to get system_topology"); } }
/** * Performs a deep copy on <i>other</i>. */ public getTopologyConf_result(getTopologyConf_result other) { if (other.is_set_success()) { this.success = other.success; } if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * set topology status as active */ @Override public void activate(String topologyName) throws TException { try { NimbusUtils.transitionName(data, topologyName, true, StatusType.activate); notifyTopologyActionListener(topologyName, "activate"); } catch (NotAliveException e) { String errMsg = "Activate Error, topology " + topologyName + " is not alive!"; LOG.error(errMsg, e); throw new NotAliveException(errMsg); } catch (Exception e) { String errMsg = "Failed to activate topology " + topologyName; LOG.error(errMsg, e); throw new TException(errMsg); } }
/** * set topology status to deactive */ @Override public void deactivate(String topologyName) throws TException { try { NimbusUtils.transitionName(data, topologyName, true, StatusType.inactivate); notifyTopologyActionListener(topologyName, "inactivate"); } catch (NotAliveException e) { String errMsg = "Deactivate Error, no this topology " + topologyName; LOG.error(errMsg, e); throw new NotAliveException(errMsg); } catch (Exception e) { String errMsg = "Failed to deactivate topology " + topologyName; LOG.error(errMsg, e); throw new TException(errMsg); } }
@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); }
public static <T> void transitionName(NimbusData data, String topologyName, boolean errorOnNoTransition, StatusType transition_status, T... args) throws Exception { StormClusterState stormClusterState = data.getStormClusterState(); String topologyId = Cluster.get_topology_id(stormClusterState, topologyName); if (topologyId == null) { throw new NotAliveException(topologyName); } transition(data, topologyId, errorOnNoTransition, transition_status, args); }
/** * check whether the topology is bActive? * * @throws Exception */ public void checkTopologyActive(NimbusData nimbus, String topologyName, boolean bActive) throws Exception { if (isTopologyActive(nimbus.getStormClusterState(), topologyName) != bActive) { if (bActive) { throw new NotAliveException(topologyName + " is not alive"); } else { throw new AlreadyAliveException(topologyName + " is already alive"); } } }
/** * Performs a deep copy on <i>other</i>. */ public getTopology_result(getTopology_result other) { if (other.is_set_success()) { this.success = new StormTopology(other.success); } if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
/** * Performs a deep copy on <i>other</i>. */ public getTopologyInfo_result(getTopologyInfo_result other) { if (other.is_set_success()) { this.success = new TopologyInfo(other.success); } if (other.is_set_e()) { this.e = new NotAliveException(other.e); } }
public static <T> void transitionName(NimbusData data, String topologyName, boolean errorOnNoTransition, StatusType transition_status, T... args) throws NotAliveException { StormClusterState stormClusterState = data.getStormClusterState(); String topologyId = Common.get_storm_id(stormClusterState, topologyName); if (topologyId == null){ throw new NotAliveException(topologyName); } transition(data, topologyId, errorOnNoTransition, transition_status, args); }
@Override public void metricMonitor(String topologyName, MonitorOptions options) throws TException { boolean isEnable = options.is_isEnable(); StormClusterState clusterState = data.getStormClusterState(); try { String topologyId = Cluster.get_topology_id(clusterState, topologyName); if (null != topologyId) { clusterState.set_storm_monitor(topologyId, isEnable); } else { throw new NotAliveException("Failed to update metricsMonitor status: " + topologyName + " is not alive"); } } catch (Exception e) { String errMsg = "Failed to update metricsMonitor " + topologyName; LOG.error(errMsg, e); throw new TException(e); } }
@Override public void completeUpgrade(String topologyName) throws TException { String topologyId = getTopologyId(topologyName); if (topologyId == null) { throw new NotAliveException(topologyName); } try { LOG.info("Force to complete upgrade for topology:{}", topologyId); StormClusterState stormClusterState = data.getStormClusterState(); GrayUpgradeConfig upgradeConfig = (GrayUpgradeConfig) stormClusterState.get_gray_upgrade_conf(topologyId); if (upgradeConfig == null) { LOG.error("Failed to get upgrade config, nothing to do."); } else { stormClusterState.remove_gray_upgrade_info(topologyId); stormClusterState.update_storm(topologyId, new StormStatus(StatusType.active)); } } catch (Exception ex) { LOG.error("Failed to complete upgrade", ex); throw new TException(ex); } }