From 464d069bb0f82a5a969c645bf11e995397d78cd9 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 18 Aug 2023 14:37:33 +0200 Subject: [PATCH] NG --- .../de/juplo/kafka/chat/backend/domain/ChatHomeService.java | 2 +- .../de/juplo/kafka/chat/backend/domain/ShardedChatHome.java | 2 +- .../de/juplo/kafka/chat/backend/domain/SimpleChatHome.java | 2 +- .../backend/persistence/inmemory/InMemoryChatHomeService.java | 3 ++- .../kafka/chat/backend/persistence/kafka/KafkaChatHome.java | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java index 19ff4aa4..9becd6ef 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java @@ -9,5 +9,5 @@ import java.util.UUID; public interface ChatHomeService { Mono getChatRoom(int shard, UUID id); - Flux getChatRooms(int shard); + Flux getChatRooms(int shard); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java index 6d2f0794..69527f66 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java @@ -47,7 +47,7 @@ public class ShardedChatHome implements ChatHome } @Override - public Flux getChatRooms() + public Flux getChatRooms() { return Flux .fromIterable(ownedShards) diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java index 11542edd..90061e65 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java @@ -36,7 +36,7 @@ public class SimpleChatHome implements ChatHome } @Override - public Flux getChatRooms() + public Flux getChatRooms() { return service.getChatRooms(shard); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatHomeService.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatHomeService.java index 8f262a0b..0f0c9524 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatHomeService.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatHomeService.java @@ -2,6 +2,7 @@ package de.juplo.kafka.chat.backend.persistence.inmemory; import de.juplo.kafka.chat.backend.domain.ChatRoom; import de.juplo.kafka.chat.backend.domain.ChatHomeService; +import de.juplo.kafka.chat.backend.domain.ChatRoomInfo; import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -63,7 +64,7 @@ public class InMemoryChatHomeService implements ChatHomeService } @Override - public Flux getChatRooms(int shard) + public Flux getChatRooms(int shard) { return Flux.fromStream(chatrooms[shard].values().stream()); } 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 ac87aac8..bf99dbff 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 @@ -2,6 +2,7 @@ package de.juplo.kafka.chat.backend.persistence.kafka; import de.juplo.kafka.chat.backend.domain.ChatHome; import de.juplo.kafka.chat.backend.domain.ChatRoom; +import de.juplo.kafka.chat.backend.domain.ChatRoomInfo; import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -- 2.20.1