Package io.streamthoughts.azkarra.api
Interface AzkarraStreamsService
-
- All Known Implementing Classes:
AbstractAzkarraStreamsService
,LocalAzkarraStreamsService
public interface AzkarraStreamsService
TheAzkarraStreamsService
serves as the main front-facing interface for manipulating streams applications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNewEnvironment(String name, String type, Conf conf)
Adds a new environment to this application.Set<StreamsExecutionEnvironment.View>
describeAllEnvironments()
Gets all existing streams environments.StreamsExecutionEnvironment.View
describeEnvironmentByName(String name)
Gets theStreamsExecutionEnvironment
for the specified name.Collection<KafkaStreamsContainer>
getAllStreamsContainersById(String applicationId)
Returns all theKafkaStreamsContainer
for the specifiedapplication.id
.List<TopologyAndAliases>
getAllTopologies()
Gets the list of all topologies.Conf
getContextConfig()
Gets the configuration ofAzkarraContext
.KafkaStreamsApplication
getStreamsApplicationById(String applicationId)
Gets all local and remote streams instances for the specified streams application.KafkaStreamsContainer
getStreamsContainerById(String containerId)
Returns theKafkaStreamsContainer
for the specified id.Set<String>
getSupportedEnvironmentTypes()
Gets all supported environment types.TopologyDescriptor
getTopologyByAliasAndQualifiers(String alias, Qualifier<? extends TopologyProvider> qualifier)
Gets theTopologyDescriptor
for the specified alias and qualifier.TopologyDescriptor
getTopologyByAliasAndVersion(String alias, String version)
Gets theTopologyDescriptor
for the specified alias and version.Set<TopologyDescriptor>
getTopologyProviders()
Gets all topologies available locally.List<Version>
getTopologyVersionsByAlias(String alias)
Gets all versions ofTopologyDescriptor
for the specified alias.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.
-
-
-
Method Detail
-
listAllKafkaStreamsContainerIds
Set<String> listAllKafkaStreamsContainerIds()
Returns the list of ids for all running Kafka Streams containers.- Returns:
- a list of string ids.
-
listAllKafkaStreamsApplicationIds
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
KafkaStreamsContainer getStreamsContainerById(String containerId)
Returns theKafkaStreamsContainer
for the specified id.- Parameters:
containerId
- the container id.- Returns:
- a
KafkaStreamsContainer
instance. - Throws:
NotFoundException
- if no Kafka Streams instance exists for the id.
-
getAllStreamsContainersById
Collection<KafkaStreamsContainer> getAllStreamsContainersById(String applicationId)
Returns all theKafkaStreamsContainer
for the specifiedapplication.id
.- Parameters:
applicationId
- theapplication.id
.- Returns:
- a
KafkaStreamsContainer
instance. - Throws:
NotFoundException
- if no Kafka Streams instance exists for the id.
-
getStreamsApplicationById
KafkaStreamsApplication getStreamsApplicationById(String applicationId)
Gets all local and remote streams instances for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- the
KafkaStreamsApplication
instance.. - Throws:
NotFoundException
- if not application exists for the id.
-
startStreamsTopology
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
-
getTopologyProviders
Set<TopologyDescriptor> getTopologyProviders()
Gets all topologies available locally.- Returns:
- a set of
TopologyDescriptor
instance.
-
getAllTopologies
List<TopologyAndAliases> getAllTopologies()
Gets the list of all topologies.- Returns:
- the list
TopologyAndAliases
.
-
getTopologyByAliasAndVersion
TopologyDescriptor getTopologyByAliasAndVersion(String alias, String version)
Gets theTopologyDescriptor
for the specified alias and version.- Parameters:
alias
- the topology alias.version
- the topology version.- Returns:
- the
TopologyDescriptor
. - Throws:
NoSuchComponentException
- if no topology exist for the given parameters.IllegalArgumentException
- if the component for the given parameters is not a Topology.
-
getTopologyByAliasAndQualifiers
TopologyDescriptor getTopologyByAliasAndQualifiers(String alias, Qualifier<? extends TopologyProvider> qualifier)
Gets theTopologyDescriptor
for the specified alias and qualifier.- Parameters:
alias
- the topology alias.qualifier
- the topology qualifier.- Returns:
- the
TopologyDescriptor
. - Throws:
NoSuchComponentException
- if no topology exist for the given parameters.IllegalArgumentException
- if the component for the given parameters is not a Topology.
-
getTopologyVersionsByAlias
List<Version> getTopologyVersionsByAlias(String alias)
Gets all versions ofTopologyDescriptor
for the specified alias.- Parameters:
alias
- the topology alias.- Throws:
NoSuchComponentException
- if no topology exist for the given parameters.
-
getContextConfig
Conf getContextConfig()
Gets the configuration ofAzkarraContext
.- Returns:
- a
Conf
object.
-
describeAllEnvironments
Set<StreamsExecutionEnvironment.View> describeAllEnvironments()
Gets all existing streams environments.- Returns:
- a set of
StreamsExecutionEnvironment
instance.
-
describeEnvironmentByName
StreamsExecutionEnvironment.View describeEnvironmentByName(String name)
Gets theStreamsExecutionEnvironment
for the specified name.- Parameters:
name
- the environment name to find.- Returns:
- the
StreamsExecutionEnvironment
. - Throws:
NotFoundException
- if no environment exists for the givenname
.
-
getSupportedEnvironmentTypes
Set<String> getSupportedEnvironmentTypes()
Gets all supported environment types.- Returns:
- the set of the environment types.
-
addNewEnvironment
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.
-
stopStreamsContainer
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.- Throws:
NotFoundException
- if no container exists for the id.- See Also:
StreamsExecutionEnvironment.stop(ContainerId, boolean)
-
restartStreamsContainer
void restartStreamsContainer(String containerId)
Restarts the streams instance for the specified container id.- Parameters:
containerId
- the container id.- Throws:
NotFoundException
- if no Kafka Streams instance exists for the id.
-
terminateStreamsContainer
void terminateStreamsContainer(String containerId)
Deletes the streams instance for the specified container id.- Parameters:
containerId
- the container id.- Throws:
NotFoundException
- if no Kafka Streams instance exists for the id.- See Also:
StreamsExecutionEnvironment.terminate(ApplicationId)
-
terminateStreamsApplication
void terminateStreamsApplication(String applicationId)
Deletes all streams instances for the specified streams application.- Parameters:
applicationId
- the streams application id.- Throws:
NotFoundException
- if not application exists for the id.- See Also:
StreamsExecutionEnvironment.terminate(ApplicationId)
-
-