@Override public String toString() { return getDefinition(); }
private boolean contains(StreamApplication application) { for (StreamApplication app : this.applications) { if (app.getType().equals(application.getType()) && app.getIdentity().equals(application.getIdentity())) { return true; } } return false; } }
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); } }
public String getDefinition(){ StringBuilder buffer = new StringBuilder(); buffer.append(getIdentity()); for(Map.Entry<String, Object> entry : properties.entrySet()){ buffer.append(" --"+entry.getKey()+"="+entry.getValue()); } return buffer.toString(); }
/** * Concatenates any deployment properties from the apps with a given map used during * {@link StreamDefinition#deploy(Map)} * @return A concatenated map containing all applications deployment properties */ private Map<String, String> resolveDeploymentProperties( Map<String, String> deploymentProperties) { Map<String, String> properties = new HashMap<>(); if (deploymentProperties != null) { properties.putAll(deploymentProperties); } for (StreamApplication app : this.applications) { for (Map.Entry<String, Object> entry : app.getDeploymentProperties() .entrySet()) { properties.put(entry.getKey(), entry.getValue().toString()); } } return properties; } }
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); }
public String getDefinition(){ StringBuilder buffer = new StringBuilder(); buffer.append(getIdentity()); for(Map.Entry<String, Object> entry : properties.entrySet()){ buffer.append(" --"+entry.getKey()+"="+entry.getValue()); } return buffer.toString(); }
/** * Concatenates any deployment properties from the apps with a given map used during * {@link StreamDefinition#deploy(Map)} * @return A concatenated map containing all applications deployment properties */ private Map<String, String> resolveDeploymentProperties( Map<String, String> deploymentProperties) { Map<String, String> properties = new HashMap<>(); if (deploymentProperties != null) { properties.putAll(deploymentProperties); } for (StreamApplication app : this.applications) { for (Map.Entry<String, Object> entry : app.getDeploymentProperties() .entrySet()) { properties.put(entry.getKey(), entry.getValue().toString()); } } return properties; } }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); } /**
private boolean contains(StreamApplication application) { for (StreamApplication app : this.applications) { if (app.getType().equals(application.getType()) && app.getIdentity().equals(application.getIdentity())) { return true; } } return false; } }
@Override public String toString() { return getDefinition(); }
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); } }
/** * Appends a {@link StreamApplication} as a source for this stream * @param source - The {@link StreamApplication} being added * @return a {@link SourceBuilder} to continue the building of the Stream */ public SourceBuilder source(StreamApplication source) { Assert.notNull(source, "Source application can't be null"); return new SourceBuilder( source.type(StreamApplication.ApplicationType.SOURCE), this); }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); } /**
/** * Appends a {@link StreamApplication} as a source for this stream * @param source - The {@link StreamApplication} being added * @return a {@link SourceBuilder} to continue the building of the Stream */ public SourceBuilder source(StreamApplication source) { Assert.notNull(source, "Source application can't be null"); return new SourceBuilder( source.type(StreamApplication.ApplicationType.SOURCE), this); }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); }
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); }