From 96f554e9792669bf83c9ce6cbbf3257481d82e16 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 4 Sep 2023 21:14:12 +0200 Subject: [PATCH] refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code --- .../chat/backend/persistence/kafka/ChatRoomChannel.java | 4 ++-- .../chat/backend/persistence/kafka/KafkaChatHome.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 b631ed51..257c6db5 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 @@ -362,7 +362,7 @@ public class ChatRoomChannel implements Runnable, ConsumerRebalanceListener .toArray(); } - Mono getChatRoom(int shard, UUID id) + Mono getChatRoomData(int shard, UUID id) { if (loadInProgress) { @@ -377,7 +377,7 @@ public class ChatRoomChannel implements Runnable, ConsumerRebalanceListener return Mono.justOrEmpty(chatrooms[shard].get(id)); } - Flux getChatRooms() + Flux getChatRoomData() { return Flux .fromStream(IntStream.range(0, numShards).mapToObj(i -> Integer.valueOf(i))) 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 cea178b2..c2e95d4d 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 @@ -34,7 +34,7 @@ public class KafkaChatHome implements ChatHome { int shard = selectShard(id); return chatRoomChannel - .getChatRoom(shard, id) + .getChatRoomData(shard, id) .switchIfEmpty(Mono.error(() -> new UnknownChatroomException( id, shard, @@ -44,7 +44,7 @@ public class KafkaChatHome implements ChatHome @Override public Flux getChatRoomInfo() { - return chatRoomChannel.getChatRooms(); + return chatRoomChannel.getChatRoomData(); } @Override @@ -52,7 +52,7 @@ public class KafkaChatHome implements ChatHome { int shard = selectShard(id); return chatRoomChannel - .getChatRoom(shard, id) + .getChatRoomData(shard, id) .switchIfEmpty(Mono.error(() -> new UnknownChatroomException( id, shard, @@ -62,7 +62,7 @@ public class KafkaChatHome implements ChatHome @Override public Flux getChatRoomData() { - return chatRoomChannel.getChatRooms(); + return chatRoomChannel.getChatRoomData(); } int selectShard(UUID chatRoomId) -- 2.20.1