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
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic StreamBuilder
builder
(DataFlowOperations client) Fluent API method to create aStreamBuilder
.void
close()
void
destroy()
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.void
rollback
(int streamVersion) Rollback the stream to the previous or a specific release version.void
scaleApplicationInstances
(StreamApplication application, int count, Map<String, String> properties) Scale up or down the number of application instances.void
undeploy()
Undeploy the currentStream
.void
Unforced Stream Update with properties string definitionvoid
Unforced Stream Update with properties map
-
Method Details
-
getName
- Returns:
- Stream name
-
getDescription
-
builder
Fluent API method to create aStreamBuilder
.- Parameters:
client
-DataFlowOperations
client 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:
close
in interfaceAutoCloseable
-