From 968e364eb376c18cfb71eae299583f564dd39809 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 4 Sep 2023 23:24:58 +0200 Subject: [PATCH] =?utf8?q?WIP:=C3=BCbefl=C3=BCssig?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/de/juplo/kafka/chat/backend/domain/ChatHome.java | 2 -- .../chat/backend/persistence/inmemory/ShardedChatHome.java | 5 ++--- .../chat/backend/persistence/inmemory/SimpleChatHome.java | 1 - .../kafka/chat/backend/persistence/kafka/KafkaChatHome.java | 1 - .../chat/backend/persistence/AbstractStorageStrategyIT.java | 4 ++-- 5 files changed, 4 insertions(+), 9 deletions(-) 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(); -- 2.20.1