Search in sources :

Example 16 with StreamsMetadata

use of org.apache.kafka.streams.StreamsMetadata in project kafka by apache.

the class StreamsMetadataTest method shouldNotBeEqualIfDifferStateStoreNames.

@Test
public void shouldNotBeEqualIfDifferStateStoreNames() {
    final StreamsMetadata differStateStoreNames = new StreamsMetadataImpl(HOST_INFO, mkSet("store1"), TOPIC_PARTITIONS, STAND_BY_STORE_NAMES, STANDBY_TOPIC_PARTITIONS);
    assertThat(streamsMetadata, not(equalTo(differStateStoreNames)));
    assertThat(streamsMetadata.hashCode(), not(equalTo(differStateStoreNames.hashCode())));
}
Also used : StreamsMetadata(org.apache.kafka.streams.StreamsMetadata) StreamsMetadataImpl(org.apache.kafka.streams.state.internals.StreamsMetadataImpl) Test(org.junit.Test)

Example 17 with StreamsMetadata

use of org.apache.kafka.streams.StreamsMetadata in project kafka by apache.

the class StreamsMetadataStateTest method shouldHaveGlobalStoreInAllMetadata.

@Test
public void shouldHaveGlobalStoreInAllMetadata() {
    final Collection<StreamsMetadata> metadata = metadataState.getAllMetadataForStore(globalTable);
    assertEquals(3, metadata.size());
    for (final StreamsMetadata streamsMetadata : metadata) {
        assertTrue(streamsMetadata.stateStoreNames().contains(globalTable));
    }
}
Also used : StreamsMetadata(org.apache.kafka.streams.StreamsMetadata) Test(org.junit.Test)

Example 18 with StreamsMetadata

use of org.apache.kafka.streams.StreamsMetadata in project kafka by apache.

the class StreamsMetadataStateTest method shouldNotThrowExceptionWhenOnChangeNotCalled.

@Test
public void shouldNotThrowExceptionWhenOnChangeNotCalled() {
    final Collection<StreamsMetadata> metadata = new StreamsMetadataState(new TopologyMetadata(TopologyWrapper.getInternalTopologyBuilder(builder.build()), new DummyStreamsConfig()), hostOne, logContext).getAllMetadataForStore("store");
    assertEquals(0, metadata.size());
}
Also used : DummyStreamsConfig(org.apache.kafka.streams.processor.internals.testutil.DummyStreamsConfig) StreamsMetadata(org.apache.kafka.streams.StreamsMetadata) Test(org.junit.Test)

Aggregations

StreamsMetadata (org.apache.kafka.streams.StreamsMetadata)18 StreamsMetadataImpl (org.apache.kafka.streams.state.internals.StreamsMetadataImpl)15 Test (org.junit.Test)12 ArrayList (java.util.ArrayList)5 TopicPartition (org.apache.kafka.common.TopicPartition)5 List (java.util.List)4 HostInfo (org.apache.kafka.streams.state.HostInfo)4 HashSet (java.util.HashSet)3 KeyQueryMetadata (org.apache.kafka.streams.KeyQueryMetadata)3 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Serdes (org.apache.kafka.common.serialization.Serdes)2 Utils.mkSet (org.apache.kafka.common.utils.Utils.mkSet)2 Duration (java.time.Duration)1 Arrays (java.util.Arrays)1 Arrays.asList (java.util.Arrays.asList)1 Collections (java.util.Collections)1