Class LocalAzkarraStreamsService
- java.lang.Object
-
- io.streamthoughts.azkarra.runtime.service.AbstractAzkarraStreamsService
-
- io.streamthoughts.azkarra.runtime.service.LocalAzkarraStreamsService
-
- All Implemented Interfaces:
AzkarraContextAware
,AzkarraStreamsService
public class LocalAzkarraStreamsService extends AbstractAzkarraStreamsService
The defaultAzkarraStreamsService
implementations.
-
-
Field Summary
-
Fields inherited from class io.streamthoughts.azkarra.runtime.service.AbstractAzkarraStreamsService
context
-
-
Constructor Summary
Constructors Constructor Description LocalAzkarraStreamsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNewEnvironment(String name, String type, Conf conf)
Adds a new environment to this application.Collection<KafkaStreamsContainer>
getAllStreamsContainersById(String applicationId)
Returns all theKafkaStreamsContainer
for the specifiedapplication.id
.Conf
getContextConfig()
Gets the configuration ofAzkarraContext
.KafkaStreamsApplication
getStreamsApplicationById(String id)
Gets all local and remote streams instances for the specified streams application.KafkaStreamsContainer
getStreamsContainerById(String containerId)
Returns theKafkaStreamsContainer
for the specified id.Set<String>
listAllKafkaStreamsApplicationIds()
Returns the list of ids for all running Kafka Streams application.Set<String>
listAllKafkaStreamsContainerIds()
Returns the list of ids for all running Kafka Streams containers.void
restartStreamsContainer(String containerId)
Restarts the streams instance for the specified container id.ApplicationId
startStreamsTopology(String topologyType, String topologyVersion, String env, Executed executed)
Creates and starts a new streams job for the specified topology into the specified environment.void
stopStreamsContainer(String containerId, boolean cleanUp)
Stops the streams instance for the specified container id.void
terminateStreamsApplication(String applicationId)
Deletes all streams instances for the specified streams application.void
terminateStreamsContainer(String containerId)
Deletes the streams instance for the specified container id.-
Methods inherited from class io.streamthoughts.azkarra.runtime.service.AbstractAzkarraStreamsService
describeAllEnvironments, describeEnvironmentByName, getAllTopologies, getSupportedEnvironmentTypes, getTopologyByAliasAndQualifiers, getTopologyByAliasAndVersion, getTopologyProviders, getTopologyVersionsByAlias, setAzkarraContext
-
-
-
-
Method Detail
-
listAllKafkaStreamsContainerIds
public Set<String> listAllKafkaStreamsContainerIds()
Returns the list of ids for all running Kafka Streams containers.- Returns:
- a list of string ids.
-
listAllKafkaStreamsApplicationIds
public Set<String> listAllKafkaStreamsApplicationIds()
Returns the list of ids for all running Kafka Streams application.- Returns:
- a list of string ids.
- See Also:
StreamsConfig.APPLICATION_ID_CONFIG
-
getStreamsContainerById
public KafkaStreamsContainer getStreamsContainerById(String containerId)
Returns theKafkaStreamsContainer
for the specified id.- Parameters:
containerId
- the container id.- Returns:
- a
KafkaStreamsContainer
instance.
-
getAllStreamsContainersById
public Collection<KafkaStreamsContainer> getAllStreamsContainersById(String applicationId)
Returns all theKafkaStreamsContainer
for the specifiedapplication.id
.- Parameters:
applicationId
- theapplication.id
.- Returns:
- a
KafkaStreamsContainer
instance.
-
startStreamsTopology
public ApplicationId startStreamsTopology(String topologyType, String topologyVersion, String env, Executed executed)
Creates and starts a new streams job for the specified topology into the specified environment.- Parameters:
topologyType
- the topology type.topologyVersion
- the topology topologyVersion.env
- the environment name.executed
- theExecuted
instance.- Returns:
- the streams application.id
-
getContextConfig
public Conf getContextConfig()
Gets the configuration ofAzkarraContext
.- Returns:
- a
Conf
object.
-
addNewEnvironment
public void addNewEnvironment(String name, String type, Conf conf)
Adds a new environment to this application.- Parameters:
name
- the environment name.type
- the environment type.conf
- the environment configuration.
-
getStreamsApplicationById
public KafkaStreamsApplication getStreamsApplicationById(String id)
Gets all local and remote streams instances for the specified streams application.- Parameters:
id
- the streams application id.- Returns:
- the
KafkaStreamsApplication
instance..
-
stopStreamsContainer
public void stopStreamsContainer(String containerId, boolean cleanUp)
Stops the streams instance for the specified container id.- Parameters:
containerId
- the container id.cleanUp
- the flag to indicate if the local streams states should be cleaned up.- See Also:
StreamsExecutionEnvironment.stop(ContainerId, boolean)
-
restartStreamsContainer
public void restartStreamsContainer(String containerId)
Restarts the streams instance for the specified container id.- Parameters:
containerId
- the container id.
-
terminateStreamsContainer
public void terminateStreamsContainer(String containerId)
Deletes the streams instance for the specified container id.- Parameters:
containerId
- the container id.- See Also:
StreamsExecutionEnvironment.terminate(ApplicationId)
-
terminateStreamsApplication
public void terminateStreamsApplication(String applicationId)
Deletes all streams instances for the specified streams application.- Parameters:
applicationId
- the streams application id.- See Also:
StreamsExecutionEnvironment.terminate(ApplicationId)
-
-