-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messages API v2 #3537
base: master
Are you sure you want to change the base?
Messages API v2 #3537
Conversation
Kudos, SonarCloud Quality Gate passed! |
…4_messagesApiV2 � Conflicts: � kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/TailingEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java � kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/RecordEmitterTest.java
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks clean, as a suggestion let's ask frontend folks to take a look at the API, if it's understandable enough for them
public static final int MAX_SIZE = 10_000; | ||
|
||
private final Cache<String, Cursor> cursorsCache = CacheBuilder.newBuilder() | ||
.maximumSize(MAX_SIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add expireAfterAccess and/or expireAfterWrite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is hard to define good properties for that. I think default policy (delete oldest when max size is reached) should work fine.
@@ -56,4 +57,8 @@ public boolean assignedPartitionsFullyPolled() { | |||
return true; | |||
} | |||
|
|||
public Set<TopicPartition> allTargetPartitions() { | |||
return Sets.union(nonEmptyPartitions, emptyPartitions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it better to calculate this in the constructor instead of doing so on every each method call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only called in once and very light to created, so I guess its better to create it lazily
@Nullable Long timestamp, | ||
@Nullable Offsets offsets) { | ||
|
||
// one of properties will be null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we assert that either is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…4_messagesApiV2 � Conflicts: � kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessageFilters.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java � kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/MessagesServiceTest.java
…4_messagesApiV2 � Conflicts: � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/ConsumingStats.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/ForwardRecordEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/TailingEmitter.java � kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/RecordEmitterTest.java
…4_messagesApiV2 � Conflicts: � kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/ConsumingStats.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/ForwardRecordEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessagesProcessing.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/OffsetsInfo.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/SeekOperations.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/TailingEmitter.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/ConsumerRecordDeserializer.java � kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java � kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/RecordEmitterTest.java
Kudos, SonarCloud Quality Gate passed! |
type: string | ||
- name: offs | ||
in: query | ||
description: partition offsets to read from / to. Format is "p1:offset1,p2:offset2,...". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int64
public static final int MAX_SIZE = 10_000; | ||
|
||
private final Cache<String, Cursor> cursorsCache = CacheBuilder.newBuilder() | ||
.maximumSize(MAX_SIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is hard to define good properties for that. I think default policy (delete oldest when max size is reached) should work fine.
@Nullable Long timestamp, | ||
@Nullable Offsets offsets) { | ||
|
||
// one of properties will be null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -56,4 +57,8 @@ public boolean assignedPartitionsFullyPolled() { | |||
return true; | |||
} | |||
|
|||
public Set<TopicPartition> allTargetPartitions() { | |||
return Sets.union(nonEmptyPartitions, emptyPartitions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only called in once and very light to created, so I guess its better to create it lazily
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)