WIP:übeflüssig
authorKai Moritz <kai@juplo.de>
Mon, 4 Sep 2023 21:24:58 +0000 (23:24 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 4 Sep 2023 21:28:42 +0000 (23:28 +0200)
src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java
src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHome.java
src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHome.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java
src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java

index a3442ae..2ff59cb 100644 (file)
@@ -15,6 +15,4 @@ public interface ChatHome
   Flux<ChatRoomInfo> getChatRoomInfo();
 
   Mono<ChatRoomData> getChatRoomData(UUID id);
-
-  Flux<ChatRoomData> getChatRoomData();
 }
index 2c9e166..eb3a6ce 100644 (file)
@@ -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<Integer> 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<ChatRoomData> getChatRoomData()
   {
     return Flux
index fb6c184..e14b01f 100644 (file)
@@ -115,7 +115,6 @@ public class SimpleChatHome implements ChatHome
         .switchIfEmpty(Mono.error(() -> new UnknownChatroomException(id)));
   }
 
-  @Override
   public Flux<ChatRoomData> getChatRoomData()
   {
     return Flux.fromIterable(chatRoomData.values());
index 5f63bf2..8c749d6 100644 (file)
@@ -59,7 +59,6 @@ public class KafkaChatHome implements ChatHome
             chatRoomChannel.getOwnedShards())));
   }
 
-  @Override
   public Flux<ChatRoomData> getChatRoomData()
   {
       return chatRoomChannel.getChatRoomData();
index 1835c85..e619649 100644 (file)
@@ -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();