From: Kai Moritz Date: Mon, 4 Sep 2023 21:24:58 +0000 (+0200) Subject: WIP:übeflüssig X-Git-Tag: rebase--2023-09-05--23-53~8 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=968e364eb376c18cfb71eae299583f564dd39809;p=demos%2Fkafka%2Fchat WIP:übeflüssig --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java index a3442ae7..2ff59cb3 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java @@ -15,6 +15,4 @@ public interface ChatHome Flux getChatRoomInfo(); Mono getChatRoomData(UUID id); - - Flux getChatRoomData(); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHome.java index 2c9e166e..eb3a6ce2 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHome.java @@ -14,13 +14,13 @@ import java.util.stream.Collectors; @Slf4j public class ShardedChatHome implements ChatHome { - private final ChatHome[] chatHomes; + private final SimpleChatHome[] chatHomes; private final Set ownedShards; private final ShardingStrategy shardingStrategy; public ShardedChatHome( - ChatHome[] chatHomes, + SimpleChatHome[] chatHomes, ShardingStrategy shardingStrategy) { this.chatHomes = chatHomes; @@ -87,7 +87,6 @@ public class ShardedChatHome implements ChatHome : throwable); } - @Override public Flux getChatRoomData() { return Flux diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHome.java index fb6c184a..e14b01fc 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHome.java @@ -115,7 +115,6 @@ public class SimpleChatHome implements ChatHome .switchIfEmpty(Mono.error(() -> new UnknownChatroomException(id))); } - @Override public Flux getChatRoomData() { return Flux.fromIterable(chatRoomData.values()); diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java index 5f63bf2b..8c749d65 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java @@ -59,7 +59,6 @@ public class KafkaChatHome implements ChatHome chatRoomChannel.getOwnedShards()))); } - @Override public Flux getChatRoomData() { return chatRoomChannel.getChatRoomData(); diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java index 1835c85e..e619649a 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java @@ -35,7 +35,7 @@ public abstract class AbstractStorageStrategyIT { start(); - assertThat(chathome.getChatRoomData().toStream()).hasSize(0); + assertThat(chathome.getChatRoomInfo().toStream()).hasSize(0); UUID chatRoomId = UUID.fromString("5c73531c-6fc4-426c-adcb-afc5c140a0f7"); ChatRoomInfo info = chathome.createChatRoom(chatRoomId, "FOO").block(); @@ -67,7 +67,7 @@ public abstract class AbstractStorageStrategyIT { start(); - assertThat(chathome.getChatRoomData().toStream()).hasSize(0); + assertThat(chathome.getChatRoomInfo().toStream()).hasSize(0); UUID chatRoomAId = UUID.fromString("5c73531c-6fc4-426c-adcb-afc5c140a0f7"); ChatRoomInfo infoA = chathome.createChatRoom(chatRoomAId, "FOO").block();