/** * Determines a deployment key for a stream application. * * @param streamAppDefinition the stream application definition * @return the deployment key */ public static String forStreamAppDefinition(StreamAppDefinition streamAppDefinition) { Assert.notNull(streamAppDefinition, "streamAppDefinition must not be null"); return String.format("%s.%s", streamAppDefinition.getStreamName(), streamAppDefinition.getName()); }
if (inputGroup != null && !inputGroup.equals(appDefinition.getStreamName())) { dslBuilder.append(" --group=").append(inputGroup);
Map<String, String> deployerDeploymentProperties = DeploymentPropertiesUtils .extractAndQualifyDeployerProperties(streamDeploymentProperties, currentApp.getName()); deployerDeploymentProperties.put(AppDeployer.GROUP_PROPERTY_KEY, currentApp.getStreamName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_NAME, currentApp.getStreamName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_LABEL, currentApp.getName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, currentApp.getApplicationType().toString()); StringBuilder sb = new StringBuilder().append(currentApp.getStreamName()).append(".") .append(currentApp.getName()).append(".").append("${spring.cloud.application.guid}"); appDeployTimeProperties.put(StreamPropertyKeys.METRICS_KEY, sb.toString());
Map<String, String> deployerDeploymentProperties = DeploymentPropertiesUtils .extractAndQualifyDeployerProperties(streamDeploymentProperties, currentApp.getName()); deployerDeploymentProperties.put(AppDeployer.GROUP_PROPERTY_KEY, currentApp.getStreamName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_NAME, currentApp.getStreamName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_LABEL, currentApp.getName()); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, currentApp.getApplicationType().toString()); StringBuilder sb = new StringBuilder().append(currentApp.getStreamName()).append(".") .append(currentApp.getName()).append(".").append("${spring.cloud.application.guid}"); appDeployTimeProperties.put(StreamPropertyKeys.METRICS_KEY, sb.toString());
/** * Create a new builder that is initialized with properties of the given * definition. Useful for "mutating" a definition by building a slightly different * copy. * * @param definition the StreamAppDefinition to create a new Builder instance with * stream name, registeredAppName, label, and properties populated * @return a StreamAppDefinition builder */ public static Builder from(StreamAppDefinition definition) { Builder builder = new Builder(); builder.setStreamName(definition.getStreamName()).setRegisteredAppName(definition.getRegisteredAppName()) .setApplicationType(definition.getApplicationType()) .setLabel(definition.getName()).addProperties(definition.getProperties()); return builder; }