@ -59,6 +59,7 @@ import org.apache.kafka.streams.utils.UniqueTopicSerdeScope;
@@ -59,6 +59,7 @@ import org.apache.kafka.streams.utils.UniqueTopicSerdeScope;
import org.apache.kafka.test.TestUtils ;
import java.util.Arrays ;
import java.util.Collections ;
import java.util.HashMap ;
import java.util.LinkedList ;
import java.util.Map ;
@ -86,6 +87,7 @@ import java.util.stream.Collectors;
@@ -86,6 +87,7 @@ import java.util.stream.Collectors;
import static org.apache.kafka.common.utils.Utils.mkSet ;
import static org.apache.kafka.streams.KeyQueryMetadata.NOT_AVAILABLE ;
import static org.apache.kafka.streams.KeyValue.pair ;
import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.DEFAULT_TIMEOUT ;
import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.safeUniqueTestName ;
import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.waitForApplicationState ;
import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.waitUntilMinKeyValueRecordsReceived ;
@ -172,9 +174,9 @@ public class NamedTopologyIntegrationTest {
@@ -172,9 +174,9 @@ public class NamedTopologyIntegrationTest {
private static final List < KeyValue < String , Long > > STANDARD_INPUT_DATA =
asList ( pair ( "A" , 100L ) , pair ( "B" , 200L ) , pair ( "A" , 300L ) , pair ( "C" , 400L ) , pair ( "C" , - 50L ) ) ;
private static final List < KeyValue < String , Long > > COUNT_OUTPUT_DATA =
asList ( pair ( "B" , 1L ) , pair ( "A" , 2L ) , pair ( "C" , 2L ) ) ; // output of count operation with caching
asList ( pair ( "A" , 1L ) , pair ( " B" , 1L ) , pair ( "A" , 2L ) , pair ( "C" , 1L ) , pair ( "C" , 2L ) ) ;
private static final List < KeyValue < String , Long > > SUM_OUTPUT_DATA =
asList ( pair ( "B" , 200L ) , pair ( "A" , 400L ) , pair ( "C" , 350L ) ) ; // output of summation with caching
asList ( pair ( "A" , 100L ) , pair ( " B" , 200L ) , pair ( "A" , 400L ) , pair ( "C" , 400L ) , pair ( "C" , 350L ) ) ;
private static final String TOPIC_PREFIX = "unique_topic_prefix" ;
private final KafkaClientSupplier clientSupplier = new DefaultKafkaClientSupplier ( ) ;
@ -207,6 +209,7 @@ public class NamedTopologyIntegrationTest {
@@ -207,6 +209,7 @@ public class NamedTopologyIntegrationTest {
streamsConfiguration . put ( StreamsConfig . COMMIT_INTERVAL_MS_CONFIG , 1000L ) ;
streamsConfiguration . put ( ConsumerConfig . AUTO_OFFSET_RESET_CONFIG , "earliest" ) ;
streamsConfiguration . put ( ConsumerConfig . SESSION_TIMEOUT_MS_CONFIG , 10 * 1000 ) ;
streamsConfiguration . put ( StreamsConfig . STATESTORE_CACHE_MAX_BYTES_CONFIG , 0 ) ;
streamsConfiguration . put ( StreamsConfig . InternalConfig . TOPIC_PREFIX_ALTERNATIVE , TOPIC_PREFIX ) ;
return streamsConfiguration ;
}
@ -318,7 +321,7 @@ public class NamedTopologyIntegrationTest {
@@ -318,7 +321,7 @@ public class NamedTopologyIntegrationTest {
. toStream ( ) . to ( OUTPUT_STREAM_1 ) ;
streams . addNamedTopology ( topology1Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
final List < KeyValue < String , Long > > results = waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) ;
final List < KeyValue < String , Long > > results = waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) ;
assertThat ( results , equalTo ( COUNT_OUTPUT_DATA ) ) ;
final Set < String > allTopics = CLUSTER . getAllTopicsInCluster ( ) ;
@ -336,9 +339,9 @@ public class NamedTopologyIntegrationTest {
@@ -336,9 +339,9 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology3Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( CLUSTER . getAllTopicsInCluster ( ) . containsAll ( asList ( changelog1 , changelog2 , changelog3 ) ) , is ( true ) ) ;
}
@ -365,7 +368,7 @@ public class NamedTopologyIntegrationTest {
@@ -365,7 +368,7 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology2Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SINGLE_PARTITION_OUTPUT_STREAM , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
final ReadOnlyKeyValueStore < String , Long > store =
@ -437,7 +440,7 @@ public class NamedTopologyIntegrationTest {
@@ -437,7 +440,7 @@ public class NamedTopologyIntegrationTest {
streams . start ( ) ;
streams . addNamedTopology ( topology1Builder . build ( ) ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -448,8 +451,10 @@ public class NamedTopologyIntegrationTest {
@@ -448,8 +451,10 @@ public class NamedTopologyIntegrationTest {
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
streams . addNamedTopology ( topology2Builder . build ( ) ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
IntegrationTestUtils . waitForApplicationState ( Collections . singletonList ( streams ) , State . RUNNING , Duration . ofMillis ( DEFAULT_TIMEOUT ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -463,9 +468,11 @@ public class NamedTopologyIntegrationTest {
@@ -463,9 +468,11 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology3Builder . build ( ) ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
IntegrationTestUtils . waitForApplicationState ( Collections . singletonList ( streams ) , State . RUNNING , Duration . ofMillis ( DEFAULT_TIMEOUT ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -481,14 +488,14 @@ public class NamedTopologyIntegrationTest {
@@ -481,14 +488,14 @@ public class NamedTopologyIntegrationTest {
streams2 . addNamedTopology ( topology1Builder2 . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( asList ( streams , streams2 ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
final AddNamedTopologyResult result = streams . addNamedTopology ( topology2Builder . build ( ) ) ;
final AddNamedTopologyResult result2 = streams2 . addNamedTopology ( topology2Builder2 . build ( ) ) ;
result . all ( ) . get ( ) ;
result2 . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -501,7 +508,7 @@ public class NamedTopologyIntegrationTest {
@@ -501,7 +508,7 @@ public class NamedTopologyIntegrationTest {
streams2 . addNamedTopology ( topology1Builder2 . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( asList ( streams , streams2 ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
final RemoveNamedTopologyResult result = streams . removeNamedTopology ( TOPOLOGY_1 , true ) ;
streams2 . removeNamedTopology ( TOPOLOGY_1 , true ) . all ( ) . get ( ) ;
@ -537,7 +544,7 @@ public class NamedTopologyIntegrationTest {
@@ -537,7 +544,7 @@ public class NamedTopologyIntegrationTest {
assertThat ( streams . getAllTopologies ( ) , equalTo ( singleton ( topology2Client1 ) ) ) ;
assertThat ( streams2 . getAllTopologies ( ) , equalTo ( singleton ( topology2Client2 ) ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -559,7 +566,7 @@ public class NamedTopologyIntegrationTest {
@@ -559,7 +566,7 @@ public class NamedTopologyIntegrationTest {
produceToInputTopics ( DELAYED_INPUT_STREAM_1 , STANDARD_INPUT_DATA ) ;
produceToInputTopics ( DELAYED_INPUT_STREAM_2 , STANDARD_INPUT_DATA ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
} finally {
CLUSTER . deleteTopics ( DELAYED_INPUT_STREAM_1 , DELAYED_INPUT_STREAM_2 ) ;
}
@ -578,8 +585,8 @@ public class NamedTopologyIntegrationTest {
@@ -578,8 +585,8 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology1Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
streams . removeNamedTopology ( TOPOLOGY_1 ) . all ( ) . get ( ) ;
streams . cleanUpNamedTopology ( TOPOLOGY_1 ) ;
@ -592,8 +599,8 @@ public class NamedTopologyIntegrationTest {
@@ -592,8 +599,8 @@ public class NamedTopologyIntegrationTest {
produceToInputTopics ( DELAYED_INPUT_STREAM_1 , STANDARD_INPUT_DATA ) ;
streams . addNamedTopology ( topology1Builder2 . build ( ) ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
} finally {
CLUSTER . deleteTopicsAndWait ( SUM_OUTPUT , COUNT_OUTPUT ) ;
CLUSTER . deleteTopics ( DELAYED_INPUT_STREAM_1 ) ;
@ -610,9 +617,9 @@ public class NamedTopologyIntegrationTest {
@@ -610,9 +617,9 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology3Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -625,9 +632,9 @@ public class NamedTopologyIntegrationTest {
@@ -625,9 +632,9 @@ public class NamedTopologyIntegrationTest {
streams . addNamedTopology ( topology3Builder . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( streams ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_3 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
}
@Test
@ -642,8 +649,8 @@ public class NamedTopologyIntegrationTest {
@@ -642,8 +649,8 @@ public class NamedTopologyIntegrationTest {
final NamedTopology namedTopology = topology1Builder . build ( ) ;
streams . addNamedTopology ( namedTopology ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
streams . removeNamedTopology ( "topology-1" , true ) . all ( ) . get ( ) ;
streams . cleanUpNamedTopology ( "topology-1" ) ;
@ -662,8 +669,8 @@ public class NamedTopologyIntegrationTest {
@@ -662,8 +669,8 @@ public class NamedTopologyIntegrationTest {
final NamedTopology namedTopologyDup = topology1BuilderDup . build ( ) ;
streams . addNamedTopology ( namedTopologyDup ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
} finally {
CLUSTER . deleteTopicsAndWait ( SUM_OUTPUT , COUNT_OUTPUT ) ;
}
@ -680,8 +687,8 @@ public class NamedTopologyIntegrationTest {
@@ -680,8 +687,8 @@ public class NamedTopologyIntegrationTest {
final NamedTopology namedTopology = topology1Builder . build ( ) ;
streams . addNamedTopology ( namedTopology ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
streams . removeNamedTopology ( TOPOLOGY_1 , true ) . all ( ) . get ( ) ;
streams . cleanUpNamedTopology ( TOPOLOGY_1 ) ;
@ -700,8 +707,8 @@ public class NamedTopologyIntegrationTest {
@@ -700,8 +707,8 @@ public class NamedTopologyIntegrationTest {
final NamedTopology namedTopologyDup = topology1BuilderDup . build ( ) ;
streams . addNamedTopology ( namedTopologyDup ) . all ( ) . get ( ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 3 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , COUNT_OUTPUT , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , SUM_OUTPUT , 5 ) , equalTo ( SUM_OUTPUT_DATA ) ) ;
CLUSTER . deleteTopicsAndWait ( SUM_OUTPUT , COUNT_OUTPUT ) ;
}
@ -723,7 +730,7 @@ public class NamedTopologyIntegrationTest {
@@ -723,7 +730,7 @@ public class NamedTopologyIntegrationTest {
streams2 . addNamedTopology ( topology1Builder2 . build ( ) ) ;
IntegrationTestUtils . startApplicationAndWaitUntilRunning ( asList ( streams , streams2 ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
topology2Builder . stream ( NEW_STREAM ) . groupBy ( ( k , v ) - > k ) . count ( IN_MEMORY_STORE ) . toStream ( ) . to ( OUTPUT_STREAM_2 ) ;
topology2Builder2 . stream ( NEW_STREAM ) . groupBy ( ( k , v ) - > k ) . count ( IN_MEMORY_STORE ) . toStream ( ) . to ( OUTPUT_STREAM_2 ) ;
@ -746,7 +753,7 @@ public class NamedTopologyIntegrationTest {
@@ -746,7 +753,7 @@ public class NamedTopologyIntegrationTest {
CLUSTER . createTopic ( NEW_STREAM , 2 , 1 ) ;
produceToInputTopics ( NEW_STREAM , STANDARD_INPUT_DATA ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 3 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
assertThat ( waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_2 , 5 ) , equalTo ( COUNT_OUTPUT_DATA ) ) ;
// Make sure the threads were not actually killed and replaced
assertThat ( streams . metadataForLocalThreads ( ) . size ( ) , equalTo ( 2 ) ) ;
@ -793,7 +800,7 @@ public class NamedTopologyIntegrationTest {
@@ -793,7 +800,7 @@ public class NamedTopologyIntegrationTest {
produceToInputTopics ( NEW_STREAM , STANDARD_INPUT_DATA ) ;
final List < KeyValue < String , Integer > > output =
waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 3 ) ;
waitUntilMinKeyValueRecordsReceived ( consumerConfig , OUTPUT_STREAM_1 , 5 ) ;
output . retainAll ( COUNT_OUTPUT_DATA ) ;
assertThat ( output , equalTo ( COUNT_OUTPUT_DATA ) ) ;