Package io.streamthoughts.azkarra.api
Interface AzkarraStreamsService
-
- All Known Implementing Classes:
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, Conf conf)
Adds a new environment to this application.void
deleteStreams(String applicationId)
Deletes the streams instance for the specified streams application.Set<Environment>
getAllEnvironments()
Gets all existing streams environments.Collection<String>
getAllStreams()
Returns the list of all running streams applications.Conf
getContextConfig()
KafkaStreamsContainer
getStreamsById(String applicationId)
Returns theKafkaStreamsContainer
for the specified streams application.Conf
getStreamsConfigById(String applicationId)
Returns theConf
for the specified streams application.ConsumerGroupOffsets
getStreamsConsumerOffsetsById(String applicationId)
Gets the topic/partitions offsets for the specified streams application.Set<StreamsServerInfo>
getStreamsInstancesById(String applicationId)
Gets all local and remote streams instances for the specified streams application.Set<MetricGroup>
getStreamsMetricsById(String applicationId)
Gets all metrics for the specified streams application.Set<MetricGroup>
getStreamsMetricsById(String applicationId, Predicate<Tuple<String,Metric>> filter)
Gets metrics for the specified streams application matching a predicate.StreamsStatus
getStreamsStatusById(String applicationId)
Returns the status for the specified streams application.StreamsTopologyGraph
getStreamsTopologyById(String applicationId)
Returns theStreamsTopologyGraph
for the specified streams application.Set<TopologyDescriptor>
getTopologyProviders()
Gets all topologies available locally.<K,V>
QueryResult<K,V>query(String applicationId, Query<K,V> query, QueryParams parameters, Queried options)
Executes an interactive query for the specified streams application.void
restartStreams(String applicationId)
Restarts the streams instance for the specified streams application.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
stopStreams(String applicationId, boolean cleanUp)
Stops the streams instance for the specified streams application.
-
-
-
Method Detail
-
getAllStreams
Collection<String> getAllStreams()
Returns the list of all running streams applications.- Returns:
- a list of string ids.
- See Also:
StreamsConfig.APPLICATION_ID_CONFIG
-
getStreamsConfigById
Conf getStreamsConfigById(String applicationId)
Returns theConf
for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- a
Optional
ofConf
. - Throws:
NotFoundException
- if not application exists for the id.
-
getStreamsById
KafkaStreamsContainer getStreamsById(String applicationId)
Returns theKafkaStreamsContainer
for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- a
KafkaStreamsContainer
instance. - Throws:
NotFoundException
- if not application exists for the id.
-
getStreamsStatusById
StreamsStatus getStreamsStatusById(String applicationId)
Returns the status for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- a
StreamsStatus
instance. - Throws:
NotFoundException
- if not application exists for the id.
-
getStreamsTopologyById
StreamsTopologyGraph getStreamsTopologyById(String applicationId)
Returns theStreamsTopologyGraph
for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- a
StreamsTopologyGraph
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.
-
getStreamsMetricsById
Set<MetricGroup> getStreamsMetricsById(String applicationId)
Gets all metrics for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- a set of
MetricGroup
instance. - Throws:
NotFoundException
- if not application exists for the id.
-
getStreamsMetricsById
Set<MetricGroup> getStreamsMetricsById(String applicationId, Predicate<Tuple<String,Metric>> filter)
Gets metrics for the specified streams application matching a predicate.- Parameters:
applicationId
- the streams application id.filter
- thePredicate
to be used for filteringMetric
.- Returns:
- a set of
MetricGroup
instance.
-
getStreamsConsumerOffsetsById
ConsumerGroupOffsets getStreamsConsumerOffsetsById(String applicationId)
Gets the topic/partitions offsets for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- the
ConsumerGroupOffsets
.
-
getContextConfig
Conf getContextConfig()
-
getAllEnvironments
Set<Environment> getAllEnvironments()
Gets all existing streams environments.- Returns:
- a set of
Environment
instance.
-
addNewEnvironment
void addNewEnvironment(String name, Conf conf)
Adds a new environment to this application.- Parameters:
name
- the environment name.conf
- the environment configuration.
-
getStreamsInstancesById
Set<StreamsServerInfo> getStreamsInstancesById(String applicationId)
Gets all local and remote streams instances for the specified streams application.- Parameters:
applicationId
- the streams application id.- Returns:
- the set of
StreamsServerInfo
instances. - Throws:
NotFoundException
- if not application exists for the id.
-
stopStreams
void stopStreams(String applicationId, boolean cleanUp)
Stops the streams instance for the specified streams application.- Parameters:
applicationId
- the streams application id.cleanUp
- the flag to indicate if the local streams states should be cleaned up.- Throws:
NotFoundException
- if not application exists for the id.
-
restartStreams
void restartStreams(String applicationId)
Restarts the streams instance for the specified streams application.- Parameters:
applicationId
- the streams application id.- Throws:
NotFoundException
- if not application exists for the id.
-
deleteStreams
void deleteStreams(String applicationId)
Deletes the streams instance for the specified streams application.- Parameters:
applicationId
- the streams application id.- Throws:
NotFoundException
- if not application exists for the id.
-
query
<K,V> QueryResult<K,V> query(String applicationId, Query<K,V> query, QueryParams parameters, Queried options)
Executes an interactive query for the specified streams application.- Parameters:
applicationId
- the streams application id.query
- theQuery
instance.parameters
- the query parameters.options
- the query execution options.- Returns:
- the
QueryResult
instance. - Throws:
InvalidStreamsStateException
- if the streams is not running for the given applicationId.
-
-