Package io.streamthoughts.azkarra.api
Interface AzkarraContext
-
- All Superinterfaces:
ComponentRegistry,ConfigurableComponentFactory
public interface AzkarraContext extends ConfigurableComponentFactory, ComponentRegistry
The AzkarraContext.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AzkarraContextaddConfiguration(Conf configuration)Adds the specifiedConfto the configuration of thisAzkarraContext.AzkarraContextaddExecutionEnvironment(StreamsExecutionEnvironment environment)Adds theStreamsExecutionEnvironmentto this context.AzkarraContextaddListener(AzkarraContextListener listener)Registers a new listener instance to this context.ApplicationIdaddTopology(Class<? extends TopologyProvider> type, Executed executed)Adds a topology to the default environment of this context.ApplicationIdaddTopology(Class<? extends TopologyProvider> type, String environment, Executed executed)Adds a topology to a specified environment.ApplicationIdaddTopology(String type, Executed executed)Adds a topology to the default environment of this context.ApplicationIdaddTopology(String type, String environment, Executed executed)Adds a topology to a specified environment.ApplicationIdaddTopology(String type, String version, String environment, Executed executed)Adds a topology to a specified environment.StreamsExecutionEnvironmentdefaultExecutionEnvironment()Gets the defaultStreamsExecutionEnvironment.List<StreamsExecutionEnvironment>environments()Gets allStreamsExecutionEnvironmentregistered to this context.ComponentFactorygetComponentFactory()Gets the internalComponentFactory.ConfgetConfiguration()Returns the global context streamsConfig of thisAzkarraContextinstance.StreamsExecutionEnvironmentgetEnvironmentForNameOrCreate(String envName)Gets theStreamsExecutionEnvironmentfor the specified name or create a new one.TopologyDescriptorgetTopology(String type)Gets the topology for the specified class name or alias.AzkarraContextsetConfiguration(Conf configuration)Sets the default configuration to be used for thisAzkarraContext.AzkarraContextsetRegisterShutdownHook(boolean registerShutdownHook)Sets if the createdAzkarraContextshould have a shutdown hook registered.voidstart()Starts thisAzkarraContextinstance.default voidstop()Stops thisAzkarraContextinstance.voidstop(boolean cleanUp)Stops thisAzkarraContextinstance.Set<TopologyDescriptor>topologyProviders()Gets all topologies registered into thisAzkarraContexteven those ones which are not enable.Set<TopologyDescriptor>topologyProviders(StreamsExecutionEnvironment env)Gets all topologies registered into thisAzkarraContextwhich are available for the given environment.-
Methods inherited from interface io.streamthoughts.azkarra.api.components.ComponentRegistry
registerComponent, registerComponent, registerComponent, registerComponent, registerSingleton, registerSingleton, registerSingleton, registerSingleton, registerSingleton
-
Methods inherited from interface io.streamthoughts.azkarra.api.components.ConfigurableComponentFactory
getAllComponents, getAllComponents, getAllComponents, getAllComponents, getComponent, getComponent, getComponent, getComponent
-
-
-
-
Method Detail
-
getComponentFactory
ComponentFactory getComponentFactory()
Gets the internalComponentFactory.- Specified by:
getComponentFactoryin interfaceConfigurableComponentFactory- Returns:
- the
ComponentFactoryinstance to be used.
-
addListener
AzkarraContext addListener(AzkarraContextListener listener)
Registers a new listener instance to this context.- Parameters:
listener- theAzkarraContextListenerinstance to register.- Returns:
- this
AzkarraContextinstance.
-
setRegisterShutdownHook
AzkarraContext setRegisterShutdownHook(boolean registerShutdownHook)
Sets if the createdAzkarraContextshould have a shutdown hook registered. Defaults totrueto ensure that JVM shutdowns are handled gracefully.- Parameters:
registerShutdownHook- if the shutdown hook should be registered- Returns:
- this
AzkarraContextinstance.
-
getConfiguration
Conf getConfiguration()
Returns the global context streamsConfig of thisAzkarraContextinstance.- Specified by:
getConfigurationin interfaceConfigurableComponentFactory- Returns:
- a
Confinstance.
-
setConfiguration
AzkarraContext setConfiguration(Conf configuration)
Sets the default configuration to be used for thisAzkarraContext.- Parameters:
configuration- theConfinstance.- Returns:
- this
AzkarraContextinstance.
-
addConfiguration
AzkarraContext addConfiguration(Conf configuration)
Adds the specifiedConfto the configuration of thisAzkarraContext.- Parameters:
configuration- theConfinstance to be used.- Returns:
- this
AzkarraContextinstance.
-
addExecutionEnvironment
AzkarraContext addExecutionEnvironment(StreamsExecutionEnvironment environment) throws AlreadyExistsException
Adds theStreamsExecutionEnvironmentto this context.- Parameters:
environment- theStreamsExecutionEnvironmentinstance.- Returns:
- this
AzkarraContextinstance. - Throws:
AlreadyExistsException- if aStreamsExecutionEnvironmentis already registered for the given name.
-
addTopology
ApplicationId addTopology(String type, Executed executed)
Adds a topology to the default environment of this context.- Parameters:
type- the fully qualified class name or alias of the targetTopologyProvider.executed- theExecutedinstance.- Returns:
- the
ApplicationIdinstance if the environment is already started, otherwisenull.
-
addTopology
ApplicationId addTopology(Class<? extends TopologyProvider> type, Executed executed)
Adds a topology to the default environment of this context.- Parameters:
type- theTopologyProviderclass to add.executed- theExecutedinstance.- Returns:
- the
ApplicationIdinstance if the environment is already started, otherwisenull.
-
addTopology
ApplicationId addTopology(Class<? extends TopologyProvider> type, String environment, Executed executed)
Adds a topology to a specified environment.- Parameters:
type- theTopologyProviderclass to add.environment- the environment name.executed- theExecutedinstance.- Returns:
- the
ApplicationIdinstance if the environment is already started, otherwisenull..
-
addTopology
ApplicationId addTopology(String type, String environment, Executed executed)
Adds a topology to a specified environment.- Parameters:
type- the fully qualified class name or alias of the targetTopologyProvider.environment- the environment name.executed- theExecutedinstance.- Returns:
- the
ApplicationIdinstance if the environment is already started, otherwisenull.
-
addTopology
ApplicationId addTopology(String type, String version, String environment, Executed executed)
Adds a topology to a specified environment.- Parameters:
type- the fully qualified class name or alias of the targetTopologyProvider.version- the topology version.environment- the environment name.executed- theExecutedinstance.- Returns:
- the
ApplicationIdinstance if the environment is already started, otherwisenull.
-
topologyProviders
Set<TopologyDescriptor> topologyProviders()
Gets all topologies registered into thisAzkarraContexteven those ones which are not enable.- Returns:
- a set of
TopologyDescriptor.
-
topologyProviders
Set<TopologyDescriptor> topologyProviders(StreamsExecutionEnvironment env)
Gets all topologies registered into thisAzkarraContextwhich are available for the given environment.- Parameters:
env- theStreamsExecutionEnvironment- Returns:
- a set of
TopologyDescriptor.
-
environments
List<StreamsExecutionEnvironment> environments()
Gets allStreamsExecutionEnvironmentregistered to this context.- Returns:
- a list of
StreamsExecutionEnvironmentinstance.
-
getEnvironmentForNameOrCreate
StreamsExecutionEnvironment getEnvironmentForNameOrCreate(String envName)
Gets theStreamsExecutionEnvironmentfor the specified name or create a new one.- Parameters:
envName- the environment name.- Returns:
- a
StreamsExecutionEnvironmentinstance with the specified name.
-
defaultExecutionEnvironment
StreamsExecutionEnvironment defaultExecutionEnvironment()
Gets the defaultStreamsExecutionEnvironment.- Returns:
- a
StreamsExecutionEnvironmentinstance.
-
getTopology
TopologyDescriptor getTopology(String type)
Gets the topology for the specified class name or alias.- Parameters:
type- the topology type.- Returns:
- the
TopologyDescriptor.
-
start
void start()
Starts thisAzkarraContextinstance.
-
stop
void stop(boolean cleanUp)
Stops thisAzkarraContextinstance.- Parameters:
cleanUp- if local states of eachKafkaStreamsinstance must be cleanup.- See Also:
.
-
stop
default void stop()
Stops thisAzkarraContextinstance.
-
-