Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Make CLI requests wait for last command sequence number #2280
Make CLI requests wait for last command sequence number #2280
Changes from 2 commits
f0cb4c0
8a96569
c15eb27
db443d9
d2b7e0c
38e8079
dc0119a
3cd3dee
cb151cc
da72ba6
93b49e3
67b1b3e
75695a0
86a1452
614c4df
6fb5f53
6613596
637c6bc
30e3bba
1e4c2b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I would suggest putting both
lastCommandSequenceNumber
andshouldWaitForPreviousCommand
into a new object, (just an inner class), as both represent state associated with the remote server.If/when the user switches to a different KSQL server, (using the
server
command), both of these should be reset. Having in a separateServerState
object, with a reset method that is called when switching servers and in its own the constructor, should ensure a nice pattern for ensuring bad state does not persist when switching servers.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, except doing so violated the class data abstraction coupling limit for
Cli.java
, which I fixed by rearranging the various calls toregisterCliSpecificCommand
(specifically, moving them all intoCliCommandRegisterUtil
. Unfortunately this resulted in the class data abstraction coupling limit forCliCommandRegisterUtil
being exceeded, but I think that's OK given the nature of the class?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.
what about if
response
is a plainKsqlEntity
? (Is this possible?)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.
Not currently possible, since
KsqlRestClient.makeKsqlRequest()
returnsRestResponse<KsqlEntityList>
. Not sure if there's a good way to set up my change to prevent errors, should this no longer be the case in the future... open to suggestions.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.
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.
I can't seem to get this proposed change to compile.
mapToLong
results in a stream ofOptionalLong
s, butmax()
only works onOptional<T>
. Am I missing something?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.
Not sure what you're doing, but this works for me:
:D
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.
Yes, you're right. Sorry for the brain fart. (
mapToLong
results in aLongStream
, to whichmax()
can be applied just fine.) Fixed.