LOG.info("Starting {} ({}), mode: {}",topologyName, executor.getClass().getCanonicalName(), config.getString("mode")); Config conf = getStormConfig(config); if (ApplicationEntity.Mode.CLUSTER.name().equalsIgnoreCase(config.getString("mode"))) { String jarFile = config.hasPath("jarPath") ? config.getString("jarPath") : null; if (jarFile == null) {
@Override public void stop(Application<StormEnvironment, StormTopology> executor, com.typesafe.config.Config config) { String appId = config.getString("appId"); LOG.info("Stopping topology {} ...", appId); if (Objects.equals(config.getString("mode"), ApplicationEntity.Mode.CLUSTER.name())) { Nimbus.Client stormClient = NimbusClient.getConfiguredClient(getStormConfig(config)).getClient(); try { stormClient.killTopologyWithOpts(appId, this.killOptions); } catch (NotAliveException | TException e) { LOG.error("Failed to kill topology named {}, due to: {}",appId,e.getMessage(),e.getCause()); throw new RuntimeException(e.getMessage(),e); } } else { getLocalCluster().killTopologyWithOpts(appId, this.killOptions); } LOG.info("Stopped topology {}", appId); }
executionConfig.put("mode", metadata.getMode().name()); executionConfig.put(MetricConfigs.METRIC_PREFIX_CONF, APP_METRIC_PREFIX);
updateSql += "apptype = ?, "; if (entity.getMode() != null && StringUtils.isNotBlank(entity.getMode().name())) { updateSql += "appmode = ?, ";
ApplicationEntity.Status status = null; try { if (Objects.equals(config.getString("mode"), ApplicationEntity.Mode.CLUSTER.name())) { Nimbus.Client stormClient = NimbusClient.getConfiguredClient(getStormConfig(config)).getClient(); topologySummaries = stormClient.getClusterInfo().get_topologies();
public ApplicationExecutionConfig(ApplicationEntity metadata) { this.siteId = metadata.getSite().getSiteId(); this.mode = metadata.getMode().name(); this.appId = metadata.getAppId(); this.jarPath = metadata.getJarPath(); }