From c4c8252a1de0c56b2f51db485a3e8747169a4fba Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 18 Aug 2023 15:55:57 +0200 Subject: [PATCH] NG --- .../java/de/juplo/kafka/chat/backend/domain/ChatHome.java | 2 +- .../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 | 2 +- .../kafka/chat/backend/persistence/kafka/ChatRoomChannel.java | 4 ++-- .../kafka/chat/backend/persistence/kafka/KafkaChatHome.java | 2 +- .../chat/backend/persistence/kafka/KafkaChatRoomService.java | 2 +- 8 files changed, 9 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 15d542a7..6091c0c5 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 @@ -10,5 +10,5 @@ public interface ChatHome { Mono getChatRoom(UUID id); - Flux getChatRooms(); + Flux getChatRooms(); } 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 9becd6ef..19ff4aa4 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 69527f66..6d2f0794 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 90061e65..11542edd 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 0f0c9524..8eaaccc6 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 @@ -64,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/ChatRoomChannel.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java index 1c6ae915..5d3f8626 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java @@ -27,7 +27,7 @@ public class ChatRoomChannel implements Runnable { private final String topic; private final Consumer consumer; - private final Map chatrooms = new HashMap<>(); + private final Map chatrooms = new HashMap<>(); private boolean running; @@ -80,7 +80,7 @@ public class ChatRoomChannel implements Runnable chatrooms.put(chatRoomInfo.getId(), chatRoomInfo); } - Flux getChatRooms() + Flux getChatRooms() { return Flux.fromIterable(chatrooms.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 bf99dbff..2bccc3ad 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 @@ -36,7 +36,7 @@ public class KafkaChatHome implements ChatHome } @Override - public Flux getChatRooms() + public Flux getChatRooms() { return chatRoomChannel.getChatRooms(); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatRoomService.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatRoomService.java index f8022348..77ecf1ca 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatRoomService.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatRoomService.java @@ -34,7 +34,7 @@ public class KafkaChatRoomService implements ChatRoomService void persistMessage(Message message) { - messages.put(message.getKey(), message); + messages.put (message.getKey(), message); } @Override -- 2.20.1