Class KafkaStreamsContainer
- java.lang.Object
-
- io.streamthoughts.azkarra.api.streams.KafkaStreamsContainer
-
public class KafkaStreamsContainer extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
applicationId()
Gets configuredStreamsConfig.APPLICATION_ID_CONFIG
for thisKafkaStreams
instance.void
close()
Closes thisKafkaStreams
instance.void
close(boolean cleanUp)
Closes thisKafkaStreams
instance.Optional<Throwable>
exception()
Gets the last observed exception thrown theKafkaStreams
instance.Set<StreamsServerInfo>
getAllMetadata()
Collection<StreamsServerInfo>
getAllMetadataForStore(String storeName)
Optional<org.apache.kafka.common.serialization.Serde>
getDefaultKeySerde()
Gets the defaultSerde
configured for key.<K,V>
LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlyKeyValueStore<K,V>>getLocalKeyValueStore(String storeName)
Optional<StreamsServerInfo>
getLocalServerInfo()
<K,V>
LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlySessionStore<K,V>>getLocalSessionStore(String storeName)
<T> LocalStoreAccessor<T>
getLocalStoreAccess(String storeName, org.apache.kafka.streams.state.QueryableStoreType<T> storeType)
<K,V>
LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlyWindowStore<K,V>>getLocalWindowStore(String storeName)
<K> StreamsServerInfo
getMetadataForStoreAndKey(String storeName, K key, org.apache.kafka.common.serialization.Serializer<K> keySerializer)
Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>
metrics()
Gets all the currentMetric
s for thisKafkaStreams
instance.void
restart()
Future<org.apache.kafka.streams.KafkaStreams.State>
start(Executor executor, boolean waitForTopicsToBeCreated)
Asynchronously start the underlyingKafkaStreams
instance.long
startedSince()
Gets the started epoch-time in milliseconds.TimestampedValue<State>
state()
Gets the current state of the streams.Conf
streamsConfig()
Gets the configuration for thisKafkaStreams
instance.Set<org.apache.kafka.streams.processor.ThreadMetadata>
threadMetadata()
Gets the local thread metadata.TopologyMetadata
topologyMetadata()
Gets theTopologyMetadata
about the topology runs by thisKafkaStreams
instance.
-
-
-
Method Detail
-
start
public Future<org.apache.kafka.streams.KafkaStreams.State> start(Executor executor, boolean waitForTopicsToBeCreated)
Asynchronously start the underlyingKafkaStreams
instance.- Parameters:
executor
- theExecutor
instance to be used for starting the streams.waitForTopicsToBeCreated
- should wait for source topics to be created before starting.- Returns:
- the future
KafkaStreams.State
of the streams.
-
state
public TimestampedValue<State> state()
Gets the current state of the streams.- Returns:
- a
TimestampedValue
instance;
-
getDefaultKeySerde
public Optional<org.apache.kafka.common.serialization.Serde> getDefaultKeySerde()
Gets the defaultSerde
configured for key.- Returns:
- a optional
Serde
instance.
-
threadMetadata
public Set<org.apache.kafka.streams.processor.ThreadMetadata> threadMetadata()
Gets the local thread metadata.- Returns:
- a set of
ThreadMetadata
instance.
-
startedSince
public long startedSince()
Gets the started epoch-time in milliseconds.- Returns:
- a unix epoch-time in milliseconds.
-
streamsConfig
public Conf streamsConfig()
Gets the configuration for thisKafkaStreams
instance.- Returns:
- a
Conf
instance.
-
applicationId
public String applicationId()
Gets configuredStreamsConfig.APPLICATION_ID_CONFIG
for thisKafkaStreams
instance.- Returns:
- a string application.id.
-
exception
public Optional<Throwable> exception()
Gets the last observed exception thrown theKafkaStreams
instance.- Returns:
- a
Throwable
instance.
-
topologyMetadata
public TopologyMetadata topologyMetadata()
Gets theTopologyMetadata
about the topology runs by thisKafkaStreams
instance.- Returns:
- a
TopologyMetadata
instance.
-
metrics
public Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics()
Gets all the currentMetric
s for thisKafkaStreams
instance.- Returns:
- a map of
Metric
.
-
close
public void close()
Closes thisKafkaStreams
instance.
-
close
public void close(boolean cleanUp)
Closes thisKafkaStreams
instance.- Parameters:
cleanUp
- flag to clean up the local streams states.
-
restart
public void restart()
-
getLocalServerInfo
public Optional<StreamsServerInfo> getLocalServerInfo()
-
getAllMetadata
public Set<StreamsServerInfo> getAllMetadata()
-
getAllMetadataForStore
public Collection<StreamsServerInfo> getAllMetadataForStore(String storeName)
-
getMetadataForStoreAndKey
public <K> StreamsServerInfo getMetadataForStoreAndKey(String storeName, K key, org.apache.kafka.common.serialization.Serializer<K> keySerializer)
-
getLocalKeyValueStore
public <K,V> LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlyKeyValueStore<K,V>> getLocalKeyValueStore(String storeName)
-
getLocalWindowStore
public <K,V> LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlyWindowStore<K,V>> getLocalWindowStore(String storeName)
-
getLocalSessionStore
public <K,V> LocalStoreAccessor<org.apache.kafka.streams.state.ReadOnlySessionStore<K,V>> getLocalSessionStore(String storeName)
-
getLocalStoreAccess
public <T> LocalStoreAccessor<T> getLocalStoreAccess(String storeName, org.apache.kafka.streams.state.QueryableStoreType<T> storeType)
-
-