Package io.streamthoughts.azkarra.api
Interface AzkarraStreamsService
-
public interface AzkarraStreamsServiceTheAzkarraStreamsServiceserves as the main front-facing interface for manipulating streams applications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddNewEnvironment(String name, Conf conf)Adds a new environment to this application.voiddeleteStreams(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.ConfgetContextConfig()KafkaStreamsContainergetStreamsById(String applicationId)Returns theKafkaStreamsContainerfor the specified streams application.ConfgetStreamsConfigById(String applicationId)Returns theConffor the specified streams application.ConsumerGroupOffsetsgetStreamsConsumerOffsetsById(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.StreamsStatusgetStreamsStatusById(String applicationId)Returns the status for the specified streams application.StreamsTopologyGraphgetStreamsTopologyById(String applicationId)Returns theStreamsTopologyGraphfor 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.voidrestartStreams(String applicationId)Restarts the streams instance for the specified streams application.ApplicationIdstartStreamsTopology(String topologyType, String topologyVersion, String env, Executed executed)Creates and starts a new streams job for the specified topology into the specified environment.voidstopStreams(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 theConffor the specified streams application.- Parameters:
applicationId- the streams application id.- Returns:
- a
OptionalofConf. - Throws:
NotFoundException- if not application exists for the id.
-
getStreamsById
KafkaStreamsContainer getStreamsById(String applicationId)
Returns theKafkaStreamsContainerfor the specified streams application.- Parameters:
applicationId- the streams application id.- Returns:
- a
KafkaStreamsContainerinstance. - 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
StreamsStatusinstance. - Throws:
NotFoundException- if not application exists for the id.
-
getStreamsTopologyById
StreamsTopologyGraph getStreamsTopologyById(String applicationId)
Returns theStreamsTopologyGraphfor the specified streams application.- Parameters:
applicationId- the streams application id.- Returns:
- a
StreamsTopologyGraphinstance. - 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- theExecutedinstance.- Returns:
- the streams application.id
-
getTopologyProviders
Set<TopologyDescriptor> getTopologyProviders()
Gets all topologies available locally.- Returns:
- a set of
TopologyDescriptorinstance.
-
getStreamsMetricsById
Set<MetricGroup> getStreamsMetricsById(String applicationId)
Gets all metrics for the specified streams application.- Parameters:
applicationId- the streams application id.- Returns:
- a set of
MetricGroupinstance. - 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- thePredicateto be used for filteringMetric.- Returns:
- a set of
MetricGroupinstance.
-
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
Environmentinstance.
-
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
StreamsServerInfoinstances. - 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- theQueryinstance.parameters- the query parameters.options- the query execution options.- Returns:
- the
QueryResultinstance. - Throws:
InvalidStreamsStateException- if the streams is not running for the given applicationId.
-
-