Skip to content

Commit 86fa67f

Browse files
committed
Fixed empty offsets
1 parent 5c4c9bc commit 86fa67f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api/src/main/java/io/kafbat/ui/model/InternalTopic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public static InternalTopic from(ScrapedClusterState.TopicState topicState,
157157
topicState.endOffsets().get(p.partition())
158158
)
159159
)
160+
).filter( e ->
161+
e.getValue().getEarliest() != null && e.getValue().getLatest() != null
160162
).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
161163

162164
return from(

api/src/test/java/io/kafbat/ui/service/TopicsServicePaginationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ private void init(Map<String, InternalTopic> topicsInCache) {
8080
new InternalPartitionsOffsets.Offsets(p.getOffsetMin(), p.getOffsetMax())
8181
)
8282
)
83+
).filter( e ->
84+
e.getValue().getEarliest() != null && e.getValue().getLatest() != null
8385
).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
8486

8587
statisticsCache.update(

0 commit comments

Comments
 (0)