Class Stream
java.lang.Object
org.springframework.cloud.dataflow.rest.client.dsl.Stream
- All Implemented Interfaces:
AutoCloseable
Represents a Stream deployed on DataFlow server. Instances of this class are created using a fluent style builder
pattern. For for instance:
Stream stream = Stream.builder(dataflowOperations).definition("time | log").create().deploy();
A fluent style that separates source, processor and sink parts can also be used via
Stream stream = Stream.builder(dataflowOperations).source("time").sink("log").create().deploy();
- Author:
- Vinicius Carvalho, Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamBuilderbuilder(DataFlowOperations client) Fluent API method to create aStreamBuilder.voidclose()voiddestroy()Destroy the stream from the server.getName()history()logs()Gets all the applications' logs for this streamlogs(StreamApplication app) Get the logs of a specific application from the streammanifest(int streamVersion) Get manifest for the given stream deployed via Skipper.voidrollback(int streamVersion) Rollback the stream to the previous or a specific release version.voidscaleApplicationInstances(StreamApplication application, int count, Map<String, String> properties) Scale up or down the number of application instances.voidundeploy()Undeploy the currentStream.voidUnforced Stream Update with properties string definitionvoidUnforced Stream Update with properties map
-
Method Details
-
getName
- Returns:
- Stream name
-
getDescription
-
builder
Fluent API method to create aStreamBuilder.- Parameters:
client-DataFlowOperationsclient instance- Returns:
- A fluent style builder to create streams
-
update
Unforced Stream Update with properties string definition- Parameters:
properties- application properties to update.
-
scaleApplicationInstances
public void scaleApplicationInstances(StreamApplication application, int count, Map<String, String> properties) Scale up or down the number of application instances.- Parameters:
application- App in the stream to scale.count- Number of instance to scale to.properties- optional scale properties.
-
update
Unforced Stream Update with properties map- Parameters:
propertiesToUse- application properties to update.
-
rollback
public void rollback(int streamVersion) Rollback the stream to the previous or a specific release version.- Parameters:
streamVersion- the version to rollback to. If the version is 0, then rollback to the previous release. The version can not be less than zero.
-
undeploy
public void undeploy()Undeploy the currentStream. This method invokes the remote server -
destroy
public void destroy()Destroy the stream from the server. This method invokes the remote server -
history
- Returns:
- list of stream versions and their statuses.
-
manifest
Get manifest for the given stream deployed via Skipper. Optionally, the version can be used to retrieve the version for a specific version of the stream.- Parameters:
streamVersion- the version of the release- Returns:
- the manifest for the given stream and version
-
getStatus
- Returns:
- Status of the deployed stream
-
logs
Gets all the applications' logs for this stream- Returns:
- the log for said stream
-
logs
Get the logs of a specific application from the stream- Parameters:
app- specific application within stream- Returns:
- the log for said application within said stream
-
runtimeApps
- Returns:
- Returns a map of the stream applications, associating every application with its applications instances
and their current runtime states:
(App -> (AppInstanceId -> AppInstanceState)).
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-