use of org.apache.kafka.streams.processor.internals.InternalTopologyBuilder in project apache-kafka-on-k8s by banzaicloud.
the class InternalStreamsBuilderTest method testNewStoreName.
@Test
public void testNewStoreName() {
assertEquals("X-STATE-STORE-0000000000", builder.newStoreName("X-"));
assertEquals("Y-STATE-STORE-0000000001", builder.newStoreName("Y-"));
assertEquals("Z-STATE-STORE-0000000002", builder.newStoreName("Z-"));
final InternalStreamsBuilder newBuilder = new InternalStreamsBuilder(new InternalTopologyBuilder());
assertEquals("X-STATE-STORE-0000000000", newBuilder.newStoreName("X-"));
assertEquals("Y-STATE-STORE-0000000001", newBuilder.newStoreName("Y-"));
assertEquals("Z-STATE-STORE-0000000002", newBuilder.newStoreName("Z-"));
}
use of org.apache.kafka.streams.processor.internals.InternalTopologyBuilder in project apache-kafka-on-k8s by banzaicloud.
the class InternalStreamsBuilderTest method testNewName.
@Test
public void testNewName() {
assertEquals("X-0000000000", builder.newProcessorName("X-"));
assertEquals("Y-0000000001", builder.newProcessorName("Y-"));
assertEquals("Z-0000000002", builder.newProcessorName("Z-"));
final InternalStreamsBuilder newBuilder = new InternalStreamsBuilder(new InternalTopologyBuilder());
assertEquals("X-0000000000", newBuilder.newProcessorName("X-"));
assertEquals("Y-0000000001", newBuilder.newProcessorName("Y-"));
assertEquals("Z-0000000002", newBuilder.newProcessorName("Z-"));
}
use of org.apache.kafka.streams.processor.internals.InternalTopologyBuilder in project kafka by apache.
the class InternalStreamsBuilderTest method testNewStoreName.
@Test
public void testNewStoreName() {
assertEquals("X-STATE-STORE-0000000000", builder.newStoreName("X-"));
assertEquals("Y-STATE-STORE-0000000001", builder.newStoreName("Y-"));
assertEquals("Z-STATE-STORE-0000000002", builder.newStoreName("Z-"));
final InternalStreamsBuilder newBuilder = new InternalStreamsBuilder(new InternalTopologyBuilder());
assertEquals("X-STATE-STORE-0000000000", newBuilder.newStoreName("X-"));
assertEquals("Y-STATE-STORE-0000000001", newBuilder.newStoreName("Y-"));
assertEquals("Z-STATE-STORE-0000000002", newBuilder.newStoreName("Z-"));
}
use of org.apache.kafka.streams.processor.internals.InternalTopologyBuilder in project kafka by apache.
the class InternalStreamsBuilderTest method testNewName.
@Test
public void testNewName() {
assertEquals("X-0000000000", builder.newProcessorName("X-"));
assertEquals("Y-0000000001", builder.newProcessorName("Y-"));
assertEquals("Z-0000000002", builder.newProcessorName("Z-"));
final InternalStreamsBuilder newBuilder = new InternalStreamsBuilder(new InternalTopologyBuilder());
assertEquals("X-0000000000", newBuilder.newProcessorName("X-"));
assertEquals("Y-0000000001", newBuilder.newProcessorName("Y-"));
assertEquals("Z-0000000002", newBuilder.newProcessorName("Z-"));
}
use of org.apache.kafka.streams.processor.internals.InternalTopologyBuilder in project kafka by apache.
the class StreamsBuilderTest method shouldNotReuseRepartitionTopicAsChangelogs.
@Test
public void shouldNotReuseRepartitionTopicAsChangelogs() {
final String topic = "topic";
builder.<Long, String>stream(topic).repartition().toTable(Materialized.as("store"));
final Properties props = StreamsTestUtils.getStreamsConfig("appId");
props.put(StreamsConfig.TOPOLOGY_OPTIMIZATION_CONFIG, StreamsConfig.OPTIMIZE);
final Topology topology = builder.build(props);
final InternalTopologyBuilder internalTopologyBuilder = TopologyWrapper.getInternalTopologyBuilder(topology);
internalTopologyBuilder.rewriteTopology(new StreamsConfig(props));
assertThat(internalTopologyBuilder.buildTopology().storeToChangelogTopic(), equalTo(Collections.singletonMap("store", "appId-store-changelog")));
assertThat(internalTopologyBuilder.stateStores().keySet(), equalTo(Collections.singleton("store")));
assertThat(internalTopologyBuilder.stateStores().get("store").loggingEnabled(), equalTo(true));
assertThat(internalTopologyBuilder.subtopologyToTopicsInfo().get(SUBTOPOLOGY_1).stateChangelogTopics.keySet(), equalTo(Collections.singleton("appId-store-changelog")));
}
Aggregations