From: Kai Moritz Date: Sat, 15 Jun 2024 19:24:58 +0000 (+0200) Subject: popular: 1.0.0 - Renamed packages and classes -- ALIGN X-Git-Tag: popular-on-top10~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=922892bcea61d489529130227c4f8669be6d7c6b;p=demos%2Fkafka%2Fwordcount popular: 1.0.0 - Renamed packages and classes -- ALIGN --- diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/Entry.java b/src/main/java/de/juplo/kafka/wordcount/popular/Entry.java index b25fc07..d732281 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/Entry.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/Entry.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AccessLevel; diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/Key.java b/src/main/java/de/juplo/kafka/wordcount/popular/Key.java index ffac8ea..8307f69 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/Key.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/Key.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.*; diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplication.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplication.java index 5c14ae7..602f3f6 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplication.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplication.java @@ -1,14 +1,14 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class Top10Application +public class PopularApplication { public static void main(String[] args) { - SpringApplication.run(Top10Application.class, args); + SpringApplication.run(PopularApplication.class, args); } } diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationConfiguration.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationConfiguration.java index 255f0e4..ca312f5 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationConfiguration.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationConfiguration.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerConfig; @@ -16,17 +16,17 @@ import org.springframework.kafka.support.serializer.JsonSerde; import java.util.Properties; import java.util.concurrent.CompletableFuture; -import static de.juplo.kafka.wordcount.top10.Top10StreamProcessor.STORE_NAME; +import static de.juplo.kafka.wordcount.popular.PopularStreamProcessor.STORE_NAME; import static org.apache.kafka.streams.errors.StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.SHUTDOWN_CLIENT; @Configuration -@EnableConfigurationProperties(Top10ApplicationProperties.class) +@EnableConfigurationProperties(PopularApplicationProperties.class) @Slf4j -public class Top10ApplicationConfiguration +public class PopularApplicationConfiguration { @Bean - public Properties streamProcessorProperties(Top10ApplicationProperties properties) + public Properties streamProcessorProperties(PopularApplicationProperties properties) { Properties props = new Properties(); @@ -64,13 +64,13 @@ public class Top10ApplicationConfiguration } @Bean(initMethod = "start", destroyMethod = "stop") - public Top10StreamProcessor streamProcessor( - Top10ApplicationProperties applicationProperties, + public PopularStreamProcessor streamProcessor( + PopularApplicationProperties applicationProperties, Properties streamProcessorProperties, KeyValueBytesStoreSupplier storeSupplier, ConfigurableApplicationContext context) { - Top10StreamProcessor streamProcessor = new Top10StreamProcessor( + PopularStreamProcessor streamProcessor = new PopularStreamProcessor( applicationProperties.getInputTopic(), applicationProperties.getOutputTopic(), streamProcessorProperties, diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationProperties.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationProperties.java index d3bb236..26c6240 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationProperties.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularApplicationProperties.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import lombok.Getter; @@ -11,7 +11,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @Getter @Setter @ToString -public class Top10ApplicationProperties +public class PopularApplicationProperties { private String bootstrapServer = "localhost:9092"; private String applicationId = "top10"; diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java index 70ead87..4320d35 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.streams.*; @@ -11,20 +11,20 @@ import java.util.Properties; @Slf4j -public class Top10StreamProcessor +public class PopularStreamProcessor { public static final String STORE_NAME= "top10"; public final KafkaStreams streams; - public Top10StreamProcessor( + public PopularStreamProcessor( String inputTopic, String outputTopic, Properties props, KeyValueBytesStoreSupplier storeSupplier) { - Topology topology = Top10StreamProcessor.buildTopology( + Topology topology = PopularStreamProcessor.buildTopology( inputTopic, outputTopic, storeSupplier); diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/Ranking.java b/src/main/java/de/juplo/kafka/wordcount/popular/Ranking.java index 4f56c18..2fa85d4 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/Ranking.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/Ranking.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import lombok.*; diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/User.java b/src/main/java/de/juplo/kafka/wordcount/popular/User.java index 53c258d..1ebea23 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/User.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/User.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java b/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java index f5ef236..63f7955 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/PopularApplicationIT.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import de.juplo.kafka.wordcount.counter.TestCounter; import de.juplo.kafka.wordcount.counter.TestWord; @@ -28,7 +28,7 @@ import org.springframework.util.MultiValueMap; import java.time.Duration; -import static de.juplo.kafka.wordcount.top10.Top10StreamProcessor.STORE_NAME; +import static de.juplo.kafka.wordcount.popular.PopularStreamProcessor.STORE_NAME; import static org.awaitility.Awaitility.await; @@ -48,11 +48,11 @@ import static org.awaitility.Awaitility.await; "juplo.wordcount.top10.bootstrap-server=${spring.embedded.kafka.brokers}", "juplo.wordcount.top10.commit-interval=100", "juplo.wordcount.top10.cacheMaxBytes=0", - "juplo.wordcount.top10.input-topic=" + Top10ApplicationIT.TOPIC_IN, - "juplo.wordcount.top10.output-topic=" + Top10ApplicationIT.TOPIC_OUT }) -@EmbeddedKafka(topics = { Top10ApplicationIT.TOPIC_IN, Top10ApplicationIT.TOPIC_OUT }) + "juplo.wordcount.top10.input-topic=" + PopularApplicationIT.TOPIC_IN, + "juplo.wordcount.top10.output-topic=" + PopularApplicationIT.TOPIC_OUT }) +@EmbeddedKafka(topics = { PopularApplicationIT.TOPIC_IN, PopularApplicationIT.TOPIC_OUT }) @Slf4j -public class Top10ApplicationIT +public class PopularApplicationIT { public static final String TOPIC_IN = "in"; public static final String TOPIC_OUT = "out"; @@ -60,7 +60,7 @@ public class Top10ApplicationIT @Autowired Consumer consumer; @Autowired - Top10StreamProcessor streamProcessor; + PopularStreamProcessor streamProcessor; @BeforeAll diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessorTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessorTopologyTest.java index 90d8e4c..0588b00 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessorTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessorTopologyTest.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import de.juplo.kafka.wordcount.counter.TestCounter; import de.juplo.kafka.wordcount.counter.TestWord; @@ -21,11 +21,11 @@ import org.springframework.util.MultiValueMap; import java.util.Map; -import static de.juplo.kafka.wordcount.top10.Top10ApplicationConfiguration.serializationConfig; +import static de.juplo.kafka.wordcount.popular.PopularApplicationConfiguration.serializationConfig; @Slf4j -public class Top10StreamProcessorTopologyTest +public class PopularStreamProcessorTopologyTest { public static final String IN = "TEST-IN"; public static final String OUT = "TEST-OUT"; @@ -40,7 +40,7 @@ public class Top10StreamProcessorTopologyTest @BeforeEach public void setUp() { - Topology topology = Top10StreamProcessor.buildTopology( + Topology topology = PopularStreamProcessor.buildTopology( IN, OUT, Stores.inMemoryKeyValueStore(STORE_NAME)); diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/RankingTest.java b/src/test/java/de/juplo/kafka/wordcount/popular/RankingTest.java index 26749e9..d8c6a0e 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/RankingTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/RankingTest.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java b/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java index 7a3a27e..8fa0512 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.wordcount.top10; +package de.juplo.kafka.wordcount.popular; import de.juplo.kafka.wordcount.counter.TestCounter; import de.juplo.kafka.wordcount.counter.TestWord;